shithub: hugo

Download patch

ref: 9d973004f5379cff2adda489566fe40683553c4c
parent: 2247546017c00201d2ce1232dd5303295451f1cc
author: Bjørn Erik Pedersen <[email protected]>
date: Thu Aug 16 08:02:31 EDT 2018

hugolib: Fix image cache-clearing for sub-languages

Fixes #5084

--- a/hugolib/page_collections.go
+++ b/hugolib/page_collections.go
@@ -319,10 +319,6 @@
 
 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)
 	}
 }