From 9d973004f5379cff2adda489566fe40683553c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 16 Aug 2018 12:02:31 +0200 Subject: [PATCH] hugolib: Fix image cache-clearing for sub-languages Fixes #5084 --- hugolib/page_collections.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hugolib/page_collections.go b/hugolib/page_collections.go index 2b2cfed0fb0..fd4b6054dbc 100644 --- a/hugolib/page_collections.go +++ b/hugolib/page_collections.go @@ -319,10 +319,6 @@ func (c *PageCollections) replacePage(page *Page) { func (c *PageCollections) clearResourceCacheForPage(page *Page) { if len(page.Resources) > 0 { - first := page.Resources[0] - dir := path.Dir(first.RelPermalink()) - dir = strings.TrimPrefix(dir, page.LanguagePrefix()) - dir = strings.TrimPrefix(dir, page.s.BaseURL.Path()) - page.s.ResourceSpec.DeleteCacheByPrefix(dir) + page.s.ResourceSpec.DeleteCacheByPrefix(page.relTargetPathBase) } }