diff options
author | tdro <tdro@noreply.example.com> | 2022-06-23 01:48:06 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-06-23 01:48:06 -0400 |
commit | 8a097206fcbf3931614ad0b36a8ad4ddc9679f27 (patch) | |
tree | 6bb8e0994fc452bfa355fc140ee7ee620a495e4a /themes/default/layouts/shortcodes | |
parent | e397c9181f0d4442d229ca0c7896608965c4afb9 (diff) | |
download | canory-8a097206fcbf3931614ad0b36a8ad4ddc9679f27.tar.gz canory-8a097206fcbf3931614ad0b36a8ad4ddc9679f27.tar.bz2 canory-8a097206fcbf3931614ad0b36a8ad4ddc9679f27.zip |
themes/default/layouts: Translate raw into generated content
Reuse short code for markdown embeds.
Diffstat (limited to 'themes/default/layouts/shortcodes')
-rw-r--r-- | themes/default/layouts/shortcodes/markdown.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/markdown.html b/themes/default/layouts/shortcodes/markdown.html new file mode 100644 index 0000000..c40c0b9 --- /dev/null +++ b/themes/default/layouts/shortcodes/markdown.html @@ -0,0 +1,14 @@ +{{- $link := default (print "/" (partial "function-paths-markdown.html") "/" .Page.File ) (.Get "link" | default (.Get 0)) -}} +{{- $name := default (path.Base .Page.File) (.Get "name" | default (.Get 1)) -}} +{{- $title := default "Markdown Embed" (.Get "title" | default (.Get 2)) -}} +{{- $embed := default false (.Get "embed" | default (.Get 3)) -}} + +{{- if $embed -}} + {{ print + "{{< self " + "url=" "\"" $link "\"" " " + "title=" "\"" $title "\"" " " + ">}}" | markdownify }} +{{- else -}} + {{- print "[" $name "]" "(" $link " " "\"" $link "\"" ")" | markdownify -}} +{{- end -}} |