From d73c7795089af1e34f218b29a87a44006ffec60d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 28 Jun 2024 09:04:37 -0700 Subject: [PATCH] Add render hooks for codeblocks, headings, and images --- layouts/_default/_markup/render-codeblock.html | 4 ++++ layouts/_default/_markup/render-heading.html | 3 +++ layouts/_default/_markup/render-image.html | 15 +++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 layouts/_default/_markup/render-codeblock.html create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 layouts/_default/_markup/render-image.html diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..e13fbb0 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,4 @@ +{{- $highlighted := transform.HighlightCodeBlock . -}} +
+{{- $highlighted.Inner -}}
+
diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..7bf5e1c --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,3 @@ + +{{ .Text | safeHTML }} # + diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..753bd43 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,15 @@ +{{- if .IsBlock }} +
+ {{ . }} + {{- with .Title }} +
{{ . }}
+ {{- end }} +
+{{ else -}} + {{ . }} +{{- end }}