diff options
author | zwbetz-gh <zwbetz@gmail.com> | 2021-03-29 06:18:56 +0300 |
---|---|---|
committer | zwbetz-gh <zwbetz@gmail.com> | 2021-03-29 06:18:56 +0300 |
commit | 699a752a936089db3afc25e3cb1f752d56305601 (patch) | |
tree | 5fd194f4364f7d49b73c6bf33d93cf0966202e6f | |
parent | 573b3dd0be2a4af66437e03ed8b7c149d202acb1 (diff) |
render markdown in shortcodes
-rw-r--r-- | exampleSite/config.toml | 44 | ||||
-rw-r--r-- | exampleSite/content/post/papercss-shortcodes/index.md | 40 | ||||
-rw-r--r-- | layouts/shortcodes/alert.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/background.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/badge.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/border.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/color.html | 2 | ||||
-rwxr-xr-x | task_serve.sh | 5 |
8 files changed, 50 insertions, 49 deletions
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 + +``` +{{</* 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 */>}} + +<h3>Example badge {{</* badge "success" */>}}[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_{{</* /badge */>}}</h3> +``` + +{{< 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 >}} + +<h3>Example badge {{< badge "success" >}}[link](https://gohugo.io/functions/markdownify/), **bold**, _italic_{{< /badge >}}</h3> 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 @@ <p class="alert alert-{{ .Get 0 }}"> - {{ .Inner }} + {{ .Inner | markdownify }} </p>
\ 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 @@ <p class="sm col background-{{ .Get 0 }}"> - {{ .Inner }} + {{ .Inner | markdownify }} </p>
\ 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 @@ <span class="badge {{ .Get 0 }}"> - {{ .Inner }} + {{ .Inner | markdownify }} </span>
\ 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 @@ <div class="child-borders"> <p class="sm col {{ $class }}"> - {{ .Inner }} + {{ .Inner | markdownify }} </p> </div>
\ 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 @@ <p class="text-{{ .Get 0 }}"> - {{ .Inner }} + {{ .Inner | markdownify }} </p>
\ 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 ..; |