diff options
author | tdro <tdro@noreply.example.com> | 2022-05-04 03:48:53 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-04 03:48:53 -0400 |
commit | 8200cb6919489187b2916fc8902f75eb4293d1a2 (patch) | |
tree | 77b1f90b81a0afc058fd80ef0aa5d04c2c80504e /themes | |
parent | 631f9369b24ee4858b258126ba9ca6a263dd2cae (diff) | |
download | canory-8200cb6919489187b2916fc8902f75eb4293d1a2.tar.gz canory-8200cb6919489187b2916fc8902f75eb4293d1a2.tar.bz2 canory-8200cb6919489187b2916fc8902f75eb4293d1a2.zip |
themes/default/layouts/shortcodes: Fix self reference
Diffstat (limited to 'themes')
-rw-r--r-- | themes/default/layouts/shortcodes/self.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/themes/default/layouts/shortcodes/self.html b/themes/default/layouts/shortcodes/self.html index 3b620b7..9ce0d6d 100644 --- a/themes/default/layouts/shortcodes/self.html +++ b/themes/default/layouts/shortcodes/self.html @@ -1,12 +1,16 @@ -{{- $url := default "https://example.org/" (.Get "url" | default (.Get 0)) -}} +{{- $url := default "" (.Get "url" | default (.Get 0)) -}} {{- $title := default "Self Embed" (.Get "title" | default (.Get 1)) -}} {{- $caption := default (print $title ": [Link](" $url ")") (.Get "caption" | default (.Get 2)) -}} {{- $sandbox := default "" (.Get "sandbox" | default (.Get 3)) -}} +{{- if (eq $url "") -}} +{{- $url = "/" -}} +{{- end -}} + <self-embed> <iframe sandbox="{{ $sandbox }}" - src="{{ $url }}" + src="{{ .Site.BaseURL }}{{ $url }}" title="{{ $title }}" ></iframe> <figcaption>{{ $caption | markdownify }}</figcaption> |