aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/self.html
blob: 2f0d7ebd351993a7961185ed5fc741fb03d4394a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{{- $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 "allow-popups"                       (.Get "sandbox" | default (.Get 3)) -}}

{{- if (eq $url "") -}}
{{- $url = "/" -}}
{{- end -}}

<self-embed>
  <iframe
    height="165"
    sandbox="{{ $sandbox }}"
    src="{{ .Site.BaseURL }}{{ $url }}"
    title="{{ $title }}"
  ></iframe>
  <footer>{{ $caption | markdownify }}</footer>
</self-embed>