updated to latest hugo version

This commit is contained in:
2019-09-06 23:49:31 -04:00
parent c798bdad5c
commit 548075696c
4 changed files with 200 additions and 10 deletions
+7 -7
View File
@@ -9,16 +9,16 @@ import (
"path"
"github.com/PuerkitoBio/goquery"
"github.com/gohugoio/hugo/hugolib"
"github.com/gohugoio/hugo/resources/page"
"git.stephensearles.com/stephen/caddy-hugo2/media"
)
func (ch *CaddyHugo) ReferencedMedia() map[string]map[*hugolib.Page]struct{} {
found := map[string]map[*hugolib.Page]struct{}{}
func (ch *CaddyHugo) ReferencedMedia() map[string]map[page.Page]struct{} {
found := map[string]map[page.Page]struct{}{}
for _, page := range ch.HugoSites.Pages() {
r := bytes.NewBufferString(string(page.Render()))
for _, pg := range ch.HugoSites.Pages() {
r := bytes.NewBufferString(string(pg.Render()))
doc, err := goquery.NewDocumentFromReader(r)
if err != nil {
continue
@@ -31,9 +31,9 @@ func (ch *CaddyHugo) ReferencedMedia() map[string]map[*hugolib.Page]struct{} {
u = ud
}
if m := found[u]; m == nil {
found[u] = make(map[*hugolib.Page]struct{})
found[u] = make(map[page.Page]struct{})
}
found[u][page] = struct{}{}
found[u][pg] = struct{}{}
}
return ""
})