hugolib: Fix image cache-clearing for sub-languages

Fixes #5084
This commit is contained in:
Bjørn Erik Pedersen 2018-08-16 12:02:31 +02:00
parent 2247546017
commit 9d973004f5

View file

@ -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)
}
}