aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-23 03:43:11 -0400
committertdro <tdro@noreply.example.com>2022-06-23 03:43:11 -0400
commit417569776aa7b199e8ac995d12db8326e350fbb3 (patch)
treef09d44a4454ac968771ca996b918841ed4fcbb2a /themes/default/layouts/shortcodes
parent8a097206fcbf3931614ad0b36a8ad4ddc9679f27 (diff)
downloadcanory-417569776aa7b199e8ac995d12db8326e350fbb3.tar.gz
canory-417569776aa7b199e8ac995d12db8326e350fbb3.tar.bz2
canory-417569776aa7b199e8ac995d12db8326e350fbb3.zip
themes/default/layouts/shortcodes/markdown: Allow variable text
Diffstat (limited to 'themes/default/layouts/shortcodes')
-rw-r--r--themes/default/layouts/shortcodes/markdown.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/themes/default/layouts/shortcodes/markdown.html b/themes/default/layouts/shortcodes/markdown.html
index c40c0b9..3bc8726 100644
--- a/themes/default/layouts/shortcodes/markdown.html
+++ b/themes/default/layouts/shortcodes/markdown.html
@@ -1,14 +1,17 @@
{{- $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)) -}}
+{{- $text := default (path.Base .Page.File) (.Get "text" | default (.Get 1)) -}}
+{{- $title := default "" (.Get "title" | default (.Get 2)) -}}
{{- $embed := default false (.Get "embed" | default (.Get 3)) -}}
{{- if $embed -}}
- {{ print
+ {{- if not $title -}}
+ {{- $title = "Markdown Embed" -}}
+ {{- end -}}
+ {{- print
"{{< self "
"url=" "\"" $link "\"" " "
"title=" "\"" $title "\"" " "
">}}" | markdownify }}
{{- else -}}
- {{- print "[" $name "]" "(" $link " " "\"" $link "\"" ")" | markdownify -}}
+ {{- print "[" $text "]" "(" $link " " "\"" (or $title $link) "\"" ")" | markdownify -}}
{{- end -}}