summaryrefslogtreecommitdiffstats
path: root/hugolib/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index d78a4e10c..ebda29f46 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1778,7 +1778,8 @@ var infoOnMissingLayout = map[string]bool{
type hookRendererTemplate struct {
templateHandler tpl.TemplateHandler
identity.SearchProvider
- templ tpl.Template
+ templ tpl.Template
+ resolvePosition func(ctx interface{}) text.Position
}
func (hr hookRendererTemplate) RenderLink(w io.Writer, ctx hooks.LinkContext) error {
@@ -1793,6 +1794,10 @@ func (hr hookRendererTemplate) RenderCodeblock(w hugio.FlexiWriter, ctx hooks.Co
return hr.templateHandler.Execute(hr.templ, w, ctx)
}
+func (hr hookRendererTemplate) ResolvePosition(ctx interface{}) text.Position {
+ return hr.resolvePosition(ctx)
+}
+
func (s *Site) renderForTemplate(name, outputFormat string, d interface{}, w io.Writer, templ tpl.Template) (err error) {
if templ == nil {
s.logMissingLayout(name, "", "", outputFormat)