From 61f05936b1e10fd84038adb821d19c0be6efcbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 3 Jun 2023 13:14:15 +0200 Subject: [PATCH] shortcodes: replace markdownify by .RenderString #555 --- exampleSite/content/shortcodes/tabs.en.md | 4 ++-- layouts/partials/body.searchpage.html | 3 ++- layouts/partials/initial.html | 2 +- layouts/partials/shortcodes/attachments.html | 2 +- layouts/partials/shortcodes/badge.html | 2 +- layouts/partials/shortcodes/button.html | 8 ++++---- layouts/partials/shortcodes/expand.html | 2 +- layouts/partials/shortcodes/notice.html | 2 +- layouts/partials/shortcodes/tabs.html | 8 ++++---- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/exampleSite/content/shortcodes/tabs.en.md b/exampleSite/content/shortcodes/tabs.en.md index b2597d43f9..cd7cbd8f94 100644 --- a/exampleSite/content/shortcodes/tabs.en.md +++ b/exampleSite/content/shortcodes/tabs.en.md @@ -59,11 +59,11 @@ echo "Hello World!" "content" (slice (dict "name" "python" - "content" ("```python\nprint(\"Hello World!\")\n```" | markdownify) + "content" ("```python\nprint(\"Hello World!\")\n```" | .RenderString) ) (dict "name" "bash" - "content" ("```bash\necho \"Hello World!\"\n```" | markdownify) + "content" ("```bash\necho \"Hello World!\"\n```" | .RenderString) ) ) )}} diff --git a/layouts/partials/body.searchpage.html b/layouts/partials/body.searchpage.html index 0502525327..ac4f1484a9 100644 --- a/layouts/partials/body.searchpage.html +++ b/layouts/partials/body.searchpage.html @@ -1,3 +1,4 @@ +{{- $page := .page }} {{- $title := T "Search" }}
@@ -9,7 +10,7 @@ {{- partial "shortcodes/button.html" (dict - "context" . + "context" $page "type" "submit" "style" "secondary" "icon" "search" diff --git a/layouts/partials/initial.html b/layouts/partials/initial.html index 1213c82ad2..a9944ab3c1 100644 --- a/layouts/partials/initial.html +++ b/layouts/partials/initial.html @@ -3,4 +3,4 @@ {{- partial "heading-pre.html" . }}

{{ $title }}

{{ partial "heading-post.html" . }} {{- end }} -{{- partial "initial.md" . | markdownify }} \ No newline at end of file +{{- partial "initial.md" . | .RenderString }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/attachments.html b/layouts/partials/shortcodes/attachments.html index e6867cf45c..532b7b9e61 100644 --- a/layouts/partials/shortcodes/attachments.html +++ b/layouts/partials/shortcodes/attachments.html @@ -30,7 +30,7 @@ {{- $urlPrefix := strings.TrimRight "/" $context.RelPermalink }} {{- with $context }}
-
{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | markdownify }}
+
{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}
    {{- $version := split hugo.Version "." }} {{- $major := int (index $version 0) }} diff --git a/layouts/partials/shortcodes/badge.html b/layouts/partials/shortcodes/badge.html index 002ffc630f..1c533e59d9 100644 --- a/layouts/partials/shortcodes/badge.html +++ b/layouts/partials/shortcodes/badge.html @@ -16,5 +16,5 @@ {{- $icon = printf "fa-fw fas fa-%s" $icon }} {{- end }} {{- with $context -}} -{{ if or $icon $title }}{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | markdownify }}{{ end }}{{ end }}{{ $content | markdownify }} +{{ if or $icon $title }}{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ if $title }}{{ $title | .RenderString }}{{ end }}{{ end }}{{ $content | .RenderString }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/button.html b/layouts/partials/shortcodes/button.html index 07689223ac..5ba48d5226 100644 --- a/layouts/partials/shortcodes/button.html +++ b/layouts/partials/shortcodes/button.html @@ -42,11 +42,11 @@ {{- else }} {{- end }} - {{- if and $icon (eq $iconposition "left") }} + {{- if and $icon (eq $iconposition "left") }} - {{- end }} - {{ $title | markdownify }} - {{- if and $icon (eq $iconposition "right") }} + {{- end }} + {{ $title | .RenderString }} + {{- if and $icon (eq $iconposition "right") }} {{- end }} {{- if $isButton }} diff --git a/layouts/partials/shortcodes/expand.html b/layouts/partials/shortcodes/expand.html index 0267fb4bf0..cbf1fc117b 100644 --- a/layouts/partials/shortcodes/expand.html +++ b/layouts/partials/shortcodes/expand.html @@ -13,7 +13,7 @@
    {{ $content | safeHTML }}
    diff --git a/layouts/partials/shortcodes/notice.html b/layouts/partials/shortcodes/notice.html index 385a51e107..7a49182aa0 100644 --- a/layouts/partials/shortcodes/notice.html +++ b/layouts/partials/shortcodes/notice.html @@ -17,7 +17,7 @@ {{- end }} {{- with $context }}
    -
    {{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | markdownify }}
    +
    {{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}
    {{ $content | safeHTML }}
    diff --git a/layouts/partials/shortcodes/tabs.html b/layouts/partials/shortcodes/tabs.html index b61c4244e0..9e936f351a 100644 --- a/layouts/partials/shortcodes/tabs.html +++ b/layouts/partials/shortcodes/tabs.html @@ -6,17 +6,17 @@
    {{- range $idx, $tab := $tabs }} + {{ .name | $context.RenderString }} {{- end }}
    {{- range $idx, $tab := $tabs }}
    {{ .content | safeHTML }}