Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rss.xml « podcast « layouts - github.com/frjo/hugo-theme-zen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fd44aa818f99bdba5192b4c6b18a924ac908610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>{{ site.Params.Podcast.Title | default site.Title }}</title>
    <link>{{ .Permalink }}</link>
    <description>{{ site.Params.Podcast.Description | default site.Params.Description }}</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>{{ site.Params.Podcast.Lang | default site.LanguageCode }}</language>
    {{ with site.Author.email -}}
    <managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</managingEditor>
    {{ end -}}
    {{ with site.Author.email -}}
    <webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</webMaster>
    {{ end -}}
    {{ with site.Copyright -}}
    <copyright>{{ . }}</copyright>
    {{ end -}}
    {{ if not .Date.IsZero -}}
    <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
    {{ end -}}
    {{ with .OutputFormats.Get "RSS" -}}
    {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
    {{ end -}}
    {{ with site.Params.Podcast.Image }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
    {{ with site.Params.Podcast.Category -}}
    <itunes:category {{ if .name }}text="{{ .name }}"{{end}}>
      {{ range .subcategories }}<itunes:category text="{{ . }}" />{{ end }}
    </itunes:category>
    {{ end -}}
    {{ with site.Params.Podcast.Owner -}}
    <itunes:owner>
    {{ with .name }}<itunes:name>{{ . }}</itunes:name>{{ end }}
    {{ with .email }}<itunes:email>{{ . }}</itunes:email>{{ end }}
    </itunes:owner>
    {{ end -}}
    {{ with site.Params.Podcast.Description }}<itunes:summary>{{ . }}</itunes:summary>{{ end }}
    {{ with site.Params.Podcast.Author }}<itunes:author>{{ . }}</itunes:author>{{ end }}
    {{ with site.Params.Podcast.Type }}<itunes:type>{{ . }}</itunes:type>{{ end }}
    {{ with site.Params.Podcast.Block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
    {{ with site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
    {{ with site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
    <itunes:explicit>{{ if site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
    {{ range .Pages }}
    <item>
      <title>{{ .Title }}</title>
      <itunes:title>{{ .Title }}</itunes:title>
      <link>{{ .Permalink }}</link>
      <guid>{{ .Permalink }}</guid>
      <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
      {{ with site.Author.email -}}
      <author>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</author>
      {{ end -}}
      <description>{{ .Content | html }}</description>
      {{ if site.Params.Podcast.local | default true -}}
      {{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ add site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
      {{ else -}}
      {{ with .Params.podcast.mp3 }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ add site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" type="audio/mpeg" />{{ end }}
      {{ end -}}
      {{ with .Params.podcast.duration }}<itunes:duration>{{ . }}</itunes:duration>{{ end }}
      {{ with .Params.podcast.image.src }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
      {{ with .Params.podcast.episode }}<itunes:episode>{{ . }}</itunes:episode>{{ end }}
      {{ with .Params.podcast.episodeType }}<itunes:episodeType>{{ . }}</itunes:episodeType>{{ end }}
      {{ with .Params.podcast.season }}<itunes:season>{{ . }}</itunes:season>{{ end }}
      {{ with .Params.podcast.block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
      <itunes:explicit>{{ if .Params.podcast.explicit }}true{{ else }}false{{ end }}</itunes:explicit>
    </item>
    {{ end }}
  </channel>
</rss>