diff options
author | Daniel Saunders <daniel.saunders@gmail.com> | 2020-02-23 06:29:01 +0300 |
---|---|---|
committer | Daniel Saunders <daniel.saunders@gmail.com> | 2020-02-23 06:29:01 +0300 |
commit | 565379334a50f9ebf00b042c03a1875b9677d522 (patch) | |
tree | 958138a6d142679bc56e39f836ee7b457839f412 | |
parent | be673c96a6db6ffc1413e847d1c67d50f6e29ca9 (diff) |
Audio param in array for OpenGraph support.20200223
-rw-r--r-- | archetypes/sermons.md | 2 | ||||
-rw-r--r-- | exampleSite/content/sermons/institutes-2-11.md | 2 | ||||
-rw-r--r-- | exampleSite/content/sermons/table-talk-word-of-god-i.md | 2 | ||||
-rw-r--r-- | layouts/sermons/sermons.rss.xml | 6 | ||||
-rw-r--r-- | layouts/sermons/single.html | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/archetypes/sermons.md b/archetypes/sermons.md index ca0b311..36de15f 100644 --- a/archetypes/sermons.md +++ b/archetypes/sermons.md @@ -2,7 +2,7 @@ title: "{{ replace .Name "-" " " | title }}" passage: "" date: {{ .Date }} -audio: "" +audio: [""] audio_duration: "1:00" audio_size: 1 preachers: [""] diff --git a/exampleSite/content/sermons/institutes-2-11.md b/exampleSite/content/sermons/institutes-2-11.md index 4cc5023..3657442 100644 --- a/exampleSite/content/sermons/institutes-2-11.md +++ b/exampleSite/content/sermons/institutes-2-11.md @@ -2,7 +2,7 @@ title: "John Calvin: Institutes 2 11" passage: "John 3:16" date: 2018-05-03T20:12:30+10:00 -audio: "//ia801403.us.archive.org/29/items/institutes_christian_religion2_1003_librivox/institutesofchristianreligion2_11_calvin_64kb.mp3" +audio: ["//ia801403.us.archive.org/29/items/institutes_christian_religion2_1003_librivox/institutesofchristianreligion2_11_calvin_64kb.mp3"] audio_duration: 22:23 audio_size: 10748346 images: [] diff --git a/exampleSite/content/sermons/table-talk-word-of-god-i.md b/exampleSite/content/sermons/table-talk-word-of-god-i.md index a216ecd..e2db85a 100644 --- a/exampleSite/content/sermons/table-talk-word-of-god-i.md +++ b/exampleSite/content/sermons/table-talk-word-of-god-i.md @@ -2,7 +2,7 @@ title: "Word of God I" passage: "Table Talk" date: 2018-05-11T09:06:46+10:00 -audio: "//www.archive.org/download/table_talk_martin_luther_1801_librivox/tabletalk_05_luther_128kb.mp3" +audio: ["//www.archive.org/download/table_talk_martin_luther_1801_librivox/tabletalk_05_luther_128kb.mp3"] audio_duration: 14:39 audio_size: 14076118 preachers: ["Martin Luther"] diff --git a/layouts/sermons/sermons.rss.xml b/layouts/sermons/sermons.rss.xml index 4206c98..3c99fae 100644 --- a/layouts/sermons/sermons.rss.xml +++ b/layouts/sermons/sermons.rss.xml @@ -44,12 +44,12 @@ {{ printf `<googleplay:description><![CDATA[%s]]></googleplay:description>` .Content | safeHTML }} {{ printf "<content:encoded><![CDATA[%s]]></content:encoded>" .Content | safeHTML }} {{- with .Params.images -}}<itunes:image href="{{ index . 0 | absURL }}"/>{{- end -}} - {{ $audio_name_arr := split .Params.audio "." }} + {{ $audio_name_arr := split (index .Params.audio 0) "." }} {{ $audio_type := index $audio_name_arr (sub (len $audio_name_arr) 1) }} {{ $audio_size := 1 }} {{- if .Params.audio_size }}{{ $audio_size = int .Params.audio_size }} {{ end -}} - <enclosure url="{{ .Params.audio }}" length="{{ $audio_size }}" type="audio/{{ $audio_type }}" /> - <guid>{{ .Params.audio }}</guid> + <enclosure url="{{ index .Params.audio 0 | absURL }}" length="{{ $audio_size }}" type="audio/{{ $audio_type }}" /> + <guid>{{ index .Params.audio 0 | absURL }}</guid> <link>{{ .Permalink }}</link> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} </pubDate> {{ with .Params.audio_duration }}<itunes:duration>{{ . }}</itunes:duration>{{ end }} diff --git a/layouts/sermons/single.html b/layouts/sermons/single.html index 63c117e..9c35733 100644 --- a/layouts/sermons/single.html +++ b/layouts/sermons/single.html @@ -13,7 +13,7 @@ {{ end }} </div> <div class="col-6 col-12-mobilep"> - {{ with .Params.audio }} + {{ range .Params.audio }} {{ $audio_name_arr := split . "." }} {{ $audio_type := index $audio_name_arr (sub (len $audio_name_arr) 1) }} <ul class="actions small"> @@ -27,7 +27,7 @@ <a href="{{ . }}" class="button alt small" download><i class="icon fas fa-download"></i> Download</a> </li> </ul> - {{ end }} {{/* with .audio */}} + {{ end }} {{/* range .Params.audio */}} {{ .Content }} {{ if .Params.preachers }} <p>Preacher: |