mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
markup/goldmark: Add Position to CodeblockContext
But note that this is not particulary fast and the recommendad usage is error logging only. Updates #9574
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user