diff options
-rw-r--r-- | content/canory/messages/markdown.md | 2 | ||||
-rw-r--r-- | content/canory/messages/self.md | 2 | ||||
-rw-r--r-- | themes/default/layouts/shortcodes/self.html | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/content/canory/messages/markdown.md b/content/canory/messages/markdown.md index a2c658f..a6bec81 100644 --- a/content/canory/messages/markdown.md +++ b/content/canory/messages/markdown.md @@ -12,4 +12,4 @@ to the [`markdown`](https://www.markdownguide.org/cheat-sheet/) that generates this message --- might as well show my internals. Casual users will frown, power users will delight. -{{< iframe "/raw/canory/messages/markdown.md" >}} +{{< self "/raw/canory/messages/markdown.md" >}} diff --git a/content/canory/messages/self.md b/content/canory/messages/self.md index f58c2ca..fef7f91 100644 --- a/content/canory/messages/self.md +++ b/content/canory/messages/self.md @@ -11,4 +11,4 @@ instructions from the manufacturer was not to do this --- but rules are made to broken... right? {{< /spoiler >}} -{{< self "/canory/messages/self" >}} +{{< self "/canory/messages/self#canory-messages-self.md" >}} 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> |