From bb895ce61d91abbe2099b73b673321749c2b0e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 14 Mar 2023 21:48:18 +0100 Subject: [PATCH] shortcodes: allow markdown for title and content #502 --- exampleSite/content/shortcodes/attachments.en.md | 4 ++-- exampleSite/content/shortcodes/badge.en.md | 6 +++--- exampleSite/content/shortcodes/button.en.md | 6 +++--- exampleSite/content/shortcodes/expand.en.md | 4 ++-- exampleSite/content/shortcodes/notice.en.md | 6 +++--- layouts/partials/shortcodes/attachments.html | 2 +- layouts/partials/shortcodes/badge.html | 2 +- layouts/partials/shortcodes/button.html | 4 ++-- layouts/partials/shortcodes/expand.html | 2 +- layouts/partials/shortcodes/notice.html | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/exampleSite/content/shortcodes/attachments.en.md b/exampleSite/content/shortcodes/attachments.en.md index 1668257da7..ebf4649c04 100644 --- a/exampleSite/content/shortcodes/attachments.en.md +++ b/exampleSite/content/shortcodes/attachments.en.md @@ -97,10 +97,10 @@ Eg. for a site in English and Piratish: ### Custom Title, List of Attachments Ending in pdf or mp4 ````go -{{%/* attachments title="Related files" pattern=".*\.(pdf|mp4)" /*/%}} +{{%/* attachments title="Related **files**" pattern=".*\.(pdf|mp4)" /*/%}} ```` -{{% attachments title="Related files" pattern=".*\.(pdf|mp4)" /%}} +{{% attachments title="Related **files**" pattern=".*\.(pdf|mp4)" /%}} ### Info Styled Box, Descending Sort Order diff --git a/exampleSite/content/shortcodes/badge.en.md b/exampleSite/content/shortcodes/badge.en.md index f5c2f4b0d0..deb9490615 100644 --- a/exampleSite/content/shortcodes/badge.en.md +++ b/exampleSite/content/shortcodes/badge.en.md @@ -188,13 +188,13 @@ While the examples are using shortcodes with named parameter you are free to als ### Other -#### With User-Defined Color and Font Awesome Brand Icon +#### With User-Defined Color, Font Awesome Brand Icon and Markdown Title and Content ````go -{{%/* badge color="fuchsia" icon="fab fa-hackerrank" %}}Awesome{{% /badge */%}} +{{%/* badge color="fuchsia" icon="fab fa-hackerrank" title="**Font**" %}}**Awesome**{{% /badge */%}} ```` -{{% badge color="fuchsia" icon="fab fa-hackerrank" %}}Awesome{{% /badge %}} +{{% badge color="fuchsia" icon="fab fa-hackerrank" title="**Font**" %}}**Awesome**{{% /badge %}} #### With Icon Content diff --git a/exampleSite/content/shortcodes/button.en.md b/exampleSite/content/shortcodes/button.en.md index a1348774fe..3a29bf45a7 100644 --- a/exampleSite/content/shortcodes/button.en.md +++ b/exampleSite/content/shortcodes/button.en.md @@ -150,13 +150,13 @@ Once the button is clicked, it opens another browser tab for the given URL. ### Other -#### With User-Defined Color and Font Awesome Brand Icon +#### With User-Defined Color, Font Awesome Brand Icon and Markdown Title ````go -{{%/* button href="https://gohugo.io/" color="fuchsia" icon="fab fa-hackerrank" %}}Hugo{{% /button */%}} +{{%/* button href="https://gohugo.io/" color="fuchsia" icon="fab fa-hackerrank" %}}Get **Hugo**{{% /button */%}} ```` -{{% button href="https://gohugo.io/" color="fuchsia" icon="fab fa-hackerrank" %}}Hugo{{% /button %}} +{{% button href="https://gohugo.io/" color="fuchsia" icon="fab fa-hackerrank" %}}Get **Hugo**{{% /button %}} #### Severity Style with All Defaults diff --git a/exampleSite/content/shortcodes/expand.en.md b/exampleSite/content/shortcodes/expand.en.md index 537bdb48a7..67b2336486 100644 --- a/exampleSite/content/shortcodes/expand.en.md +++ b/exampleSite/content/shortcodes/expand.en.md @@ -72,7 +72,7 @@ While the examples are using shortcodes with named parameter you are free to use ### Arbitrary Text ````go -{{%/* expand title="Show me almost endless possibilities" */%}} +{{%/* expand title="Show me almost **endless** possibilities" */%}} You can add standard markdown syntax: - multiple paragraphs @@ -89,7 +89,7 @@ You can add standard markdown syntax: {{%/* /expand */%}} ```` -{{% expand title="Show me almost endless possibilities" %}} +{{% expand title="Show me almost **endless** possibilities" %}} You can add standard markdown syntax: - multiple paragraphs diff --git a/exampleSite/content/shortcodes/notice.en.md b/exampleSite/content/shortcodes/notice.en.md index 9482d65cc0..96fe19d24e 100644 --- a/exampleSite/content/shortcodes/notice.en.md +++ b/exampleSite/content/shortcodes/notice.en.md @@ -286,14 +286,14 @@ Some serious information. Some serious information. {{% /notice %}} -### With User-Defined Color and Font Awesome Brand Icon +### With User-Defined Color, Font Awesome Brand Icon and Markdown Title ````go -{{%/* notice color="fuchsia" title="Hugo" icon="fab fa-hackerrank" */%}} +{{%/* notice color="fuchsia" title="**Hugo**" icon="fab fa-hackerrank" */%}} Victor? Is it you? {{%/* /notice */%}} ```` -{{% notice color="fuchsia" title="Hugo" icon="fab fa-hackerrank" %}} +{{% notice color="fuchsia" title="**Hugo**" icon="fab fa-hackerrank" %}} Victor? Is it you? {{% /notice %}} diff --git a/layouts/partials/shortcodes/attachments.html b/layouts/partials/shortcodes/attachments.html index 0b2cf802c1..c05809310d 100644 --- a/layouts/partials/shortcodes/attachments.html +++ b/layouts/partials/shortcodes/attachments.html @@ -30,7 +30,7 @@ {{- $urlPrefix := strings.TrimRight "/" $context.Page.RelPermalink }} {{- with $context }}
-
{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title }}
+
{{ if $icon }}{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | markdownify }}