mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -440,8 +440,8 @@ func (pco *pageContentOutput) initRenderHooks() error {
|
||||
var offset int
|
||||
|
||||
switch v := ctx.(type) {
|
||||
case hooks.CodeblockContext:
|
||||
offset = bytes.Index(source, []byte(v.Inner()))
|
||||
case hooks.PositionerSourceTargetProvider:
|
||||
offset = bytes.Index(source, v.PositionerSourceTarget())
|
||||
}
|
||||
|
||||
pos := pco.po.p.posFromInput(source, offset)
|
||||
@@ -481,6 +481,11 @@ func (pco *pageContentOutput) initRenderHooks() error {
|
||||
if id != nil {
|
||||
layoutDescriptor.KindVariants = id.(string)
|
||||
}
|
||||
case hooks.BlockquoteRendererType:
|
||||
layoutDescriptor.Kind = "render-blockquote"
|
||||
if id != nil {
|
||||
layoutDescriptor.KindVariants = id.(string)
|
||||
}
|
||||
case hooks.CodeBlockRendererType:
|
||||
layoutDescriptor.Kind = "render-codeblock"
|
||||
if id != nil {
|
||||
|
@@ -919,6 +919,10 @@ func (hr hookRendererTemplate) RenderPassthrough(cctx context.Context, w io.Writ
|
||||
return hr.templateHandler.ExecuteWithContext(cctx, hr.templ, w, ctx)
|
||||
}
|
||||
|
||||
func (hr hookRendererTemplate) RenderBlockquote(cctx context.Context, w hugio.FlexiWriter, ctx hooks.BlockquoteContext) error {
|
||||
return hr.templateHandler.ExecuteWithContext(cctx, hr.templ, w, ctx)
|
||||
}
|
||||
|
||||
func (hr hookRendererTemplate) ResolvePosition(ctx any) text.Position {
|
||||
return hr.resolvePosition(ctx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user