Add markup renderers

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-08 10:53:21 +02:00
parent ccabcf9d5b
commit a7d1faa0a8
7 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
<h{{ .Level }} id="{{- .Anchor | safeURL -}}" class="heading">
{{ .Text | safeHTML }}
<a href="#{{- .Anchor | safeURL -}}" class="heading-anchor">#</a>
</h{{ .Level }}>

View File

@@ -0,0 +1,6 @@
{{ partial "image.html" (dict
"path" .Destination
"caption" .Text
"alt" .Title
)
}}

View File

@@ -0,0 +1,9 @@
<a
href="{{- .Destination | safeURL -}}"
{{ with .Title }}title="{{- . -}}"{{ end }}
{{ if strings.HasPrefix .Destination "http" }}
target="_blank" rel="noopener"
{{ end }}
>
{{ .Text | safeHTML }}
</a>