Skip to content

Commit

Permalink
hugolib: Fix image cache-clearing for sub-languages
Browse files Browse the repository at this point in the history
Fixes #5084
  • Loading branch information
bep committed Aug 16, 2018
1 parent 2247546 commit 9d97300
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions hugolib/page_collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 9d97300

Please sign in to comment.