A first attempt at supporting podcasts. iTunes RSS feed, layouts, parameters etc. included.
This commit is contained in:
parent
73cc5ad40b
commit
9d40eac2d6
3 changed files with 252 additions and 33 deletions
6
layouts/shortcodes/audio.html
Normal file
6
layouts/shortcodes/audio.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
|
||||
<audio controls preload="{{ .Get "preload" | default "metadata" }}">
|
||||
{{ with .Get "src" }}<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
|
||||
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
|
||||
</audio>
|
||||
</figure>
|
||||
|
|
@ -25,9 +25,9 @@
|
|||
{{ $height := (mul ($.Scratch.Get "realheight") (div (add ($.Scratch.Get "width") 0.0) ($.Scratch.Get "realwidth"))) -}}
|
||||
{{ $.Scratch.Set "height" (math.Round $height) -}}
|
||||
{{ end -}}
|
||||
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
|
||||
<figure class="image {{ .Get "class" | default "" }}">
|
||||
{{ with .Get "link" }}<a href="{{ . }}">{{ end -}}
|
||||
<img src="{{ $.Get "src" | relURL }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }}{{ with $.Scratch.Get "width" }} width="{{ . }}"{{ end }}{{ with $.Scratch.Get "height" }} height="{{ . }}"{{ end }}>
|
||||
<img src="{{ .Get "src" | relURL }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }}{{ with $.Scratch.Get "width" }} width="{{ . }}"{{ end }}{{ with $.Scratch.Get "height" }} height="{{ . }}"{{ end }}>
|
||||
{{- if .Get "link" }}</a>{{ end }}
|
||||
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||
<figcaption>{{ if isset .Params "title" }}
|
||||
|
|
|
|||
6
layouts/shortcodes/video.html
Normal file
6
layouts/shortcodes/video.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
|
||||
<video controls preload="{{ .Get "preload" | default "metadata" }}" {{ with .Get "width" }}width="{{ . }}"{{ end }}>
|
||||
{{ with .Get "src" }}<source src="{{ . | relURL }}" type="video/mp4">{{ end }}
|
||||
</video>
|
||||
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
Loading…
Reference in a new issue