From 699a752a936089db3afc25e3cb1f752d56305601 Mon Sep 17 00:00:00 2001 From: zwbetz-gh Date: Sun, 28 Mar 2021 22:18:56 -0500 Subject: render markdown in shortcodes --- exampleSite/config.toml | 44 ---------------------- .../content/post/papercss-shortcodes/index.md | 40 ++++++++++++++++++++ layouts/shortcodes/alert.html | 2 +- layouts/shortcodes/background.html | 2 +- layouts/shortcodes/badge.html | 2 +- layouts/shortcodes/border.html | 2 +- layouts/shortcodes/color.html | 2 +- task_serve.sh | 5 +++ 8 files changed, 50 insertions(+), 49 deletions(-) delete mode 100644 exampleSite/config.toml create mode 100755 task_serve.sh diff --git a/exampleSite/config.toml b/exampleSite/config.toml deleted file mode 100644 index a9a2bf2..0000000 --- a/exampleSite/config.toml +++ /dev/null @@ -1,44 +0,0 @@ -baseURL = "https://example.com" -languageCode = "en-us" -defaultContentLanguage = "en" -title = "PaperCSS" -theme = "papercss-hugo-theme" -googleAnalytics = "UA-123456789-1" -disqusShortname = "yourdiscussshortname" - -[privacy] - [privacy.disqus] - disable = true - -[taxonomies] - tag = "tags" - -[permalinks] - post = "/:filename/" - -[imaging] - quality = 99 - -[params] - homeMetaContent = "A Hugo theme made with PaperCSS, the less formal CSS framework." - # For more date formats see https://gohugo.io/functions/format/ - dateFormat = "Jan 2, 2006" - navTitleLink = "/" - -[menu] - [[menu.nav]] - name = "Blog" - url = "/" - weight = 1 - [[menu.nav]] - name = "Tags" - url = "/tags/" - weight = 2 - [[menu.nav]] - name = "About" - url = "/about/" - weight = 3 - [[menu.nav]] - name = "RSS" - url = "/index.xml" - weight = 4 diff --git a/exampleSite/content/post/papercss-shortcodes/index.md b/exampleSite/content/post/papercss-shortcodes/index.md index fb58740..b279301 100644 --- a/exampleSite/content/post/papercss-shortcodes/index.md +++ b/exampleSite/content/post/papercss-shortcodes/index.md @@ -242,3 +242,43 @@ options="900x" title="The Sun" subtitle="It's the Sun, dude" text="The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. It is by far the most important source of energy for life on Earth. [Credits](https://images.nasa.gov/details-GSFC_20171208_Archive_e000393.html)." >}} + +## With Markdown + +``` +{{}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{}} + +{{}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{}} + +{{}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{}} + +{{}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{}} + +

Example badge {{}}[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_{{}}

+``` + +{{< border >}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{< /border >}} + +{{< color "success" >}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{< /color >}} + +{{< background "success" >}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{< /background >}} + +{{< alert "success" >}} +[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_ +{{< /alert >}} + +

Example badge {{< badge "success" >}}[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_{{< /badge >}}

diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html index 200f43b..0522ebb 100644 --- a/layouts/shortcodes/alert.html +++ b/layouts/shortcodes/alert.html @@ -1,3 +1,3 @@

- {{ .Inner }} + {{ .Inner | markdownify }}

\ No newline at end of file diff --git a/layouts/shortcodes/background.html b/layouts/shortcodes/background.html index 5ddc8ec..5d06c3c 100644 --- a/layouts/shortcodes/background.html +++ b/layouts/shortcodes/background.html @@ -1,3 +1,3 @@

- {{ .Inner }} + {{ .Inner | markdownify }}

\ No newline at end of file diff --git a/layouts/shortcodes/badge.html b/layouts/shortcodes/badge.html index 94ee273..f773f28 100644 --- a/layouts/shortcodes/badge.html +++ b/layouts/shortcodes/badge.html @@ -1,3 +1,3 @@ - {{ .Inner }} + {{ .Inner | markdownify }} \ No newline at end of file diff --git a/layouts/shortcodes/border.html b/layouts/shortcodes/border.html index 46177bd..2b4accd 100644 --- a/layouts/shortcodes/border.html +++ b/layouts/shortcodes/border.html @@ -12,6 +12,6 @@

- {{ .Inner }} + {{ .Inner | markdownify }}

\ No newline at end of file diff --git a/layouts/shortcodes/color.html b/layouts/shortcodes/color.html index c87a3e0..637f336 100644 --- a/layouts/shortcodes/color.html +++ b/layouts/shortcodes/color.html @@ -1,3 +1,3 @@

- {{ .Inner }} + {{ .Inner | markdownify }}

\ No newline at end of file diff --git a/task_serve.sh b/task_serve.sh new file mode 100755 index 0000000..fafe2f6 --- /dev/null +++ b/task_serve.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +cd exampleSite; +hugo serve --themesDir ../..; +cd ..; -- cgit v1.2.3