summaryrefslogtreecommitdiffstats
path: root/hugolib/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index ac65931d0..dad5ab538 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1538,6 +1538,7 @@ func (s *Site) resetBuildState(sourceChanged bool) {
s.init.Reset()
if sourceChanged {
+ s.pageMap.contentMap.pageReverseIndex.Reset()
s.PageCollections = newPageCollections(s.pageMap)
s.pageMap.withEveryBundlePage(func(p *pageState) bool {
p.pagePages = &pagePages{}
@@ -1587,6 +1588,18 @@ func (s *SiteInfo) GetPage(ref ...string) (page.Page, error) {
return p, err
}
+func (s *SiteInfo) GetPageWithTemplateInfo(info tpl.Info, ref ...string) (page.Page, error) {
+ p, err := s.GetPage(ref...)
+ if p != nil {
+ // Track pages referenced by templates/shortcodes
+ // when in server mode.
+ if im, ok := info.(identity.Manager); ok {
+ im.Add(p)
+ }
+ }
+ return p, err
+}
+
func (s *Site) permalink(link string) string {
return s.PathSpec.PermalinkForBaseURL(link, s.PathSpec.BaseURL.String())
}