hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 9d973004f5379cff2adda489566fe40683553c4c
parent 2247546017c00201d2ce1232dd5303295451f1cc
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Thu, 16 Aug 2018 12:02:31 +0200

hugolib: Fix image cache-clearing for sub-languages

Fixes #5084

Diffstat:
Mhugolib/page_collections.go | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git 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)
 	}
 }