updated to latest hugo version
This commit is contained in:
@@ -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 ""
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user