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

episode.rss.xml « section « layouts - github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f0766cf348dfd67f47e5cd2c362f53abac9390cc (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
     xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
     xmlns:media="http://search.yahoo.com/mrss/"
     xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"
    >
  <channel>
    <title>{{ $.Site.Title }}</title>
    <atom:link href="{{ "episode/index.xml" | absURL }}" rel="self" type="application/rss+xml" />
    <link>{{ .Site.BaseURL }}</link>
    <description>{{ .Site.Params.feed.itunes_summary | truncate 4000 ""}}</description>
    <lastBuildDate>{{ dateFormat "Mon, 2 Jan 2006 15:04:05 -0700" .Date }}</lastBuildDate>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <language>{{ .Site.Params.feed.language | default .Site.LanguageCode }}</language>
    <copyright>{{ .Site.Params.feed.copyright }}</copyright>
    {{ with .Site.Params.feed.itunes_subtitle }}<itunes:subtitle>{{ . }}</itunes:subtitle>{{ end }}
    <itunes:author>{{ .Site.Params.feed.itunes_author }}</itunes:author>
    <itunes:type>episodic</itunes:type>
    <googleplay:author>{{ .Site.Params.feed.itunes_author }}</googleplay:author>
    <googleplay:email>{{ .Site.Params.feed.itunes_owner_email }}</googleplay:email>
    <itunes:summary>{{ .Site.Params.feed.itunes_summary | truncate 4000 ""}}</itunes:summary>
    <googleplay:description>{{ .Site.Params.feed.itunes_summary | truncate 4000 ""}}</googleplay:description>
    <itunes:owner>
      <itunes:name>{{ .Site.Params.feed.itunes_owner_name }}</itunes:name>
      <itunes:email>{{ .Site.Params.feed.itunes_owner_email }}</itunes:email>
    </itunes:owner>
    <itunes:image href="{{ .Site.Params.feed.itunes_image }}" />
    <googleplay:image href="{{ .Site.Params.feed.itunes_image }}"></googleplay:image>
    <image>
      <url>{{ .Site.Params.feed.itunes_image }}</url>
      <title>{{ $.Site.Title }}</title>
      <link>{{ .Site.BaseURL }}</link>
    </image>
    <itunes:category text="{{ .Site.Params.feed.itunes_top_category }}">
      {{ with .Site.Params.feed.itunes_first_sub_category -}}
      <itunes:category text="{{ . }}" />
      {{- end -}}
      {{- with .Site.Params.feed.itunes_second_sub_category -}}
      <itunes:category text="{{ . }}" />
      {{- end -}}
    </itunes:category>
    {{- if isset .Site.Params.feed "explicit" -}}
    <itunes:explicit>{{ .Site.Params.feed.explicit }}</itunes:explicit>
    <googleplay:explicit>{{ .Site.Params.feed.explicit }}</googleplay:explicit>
    {{- end -}}
    <generator>Hugo -- gohugo.io</generator>
    {{- range (where ( where .Site.Pages "Type" "episode") ".Params.upcoming" "!=" true) -}}
      {{ if isset .Params "podcast_file" }}
        <item>          
          {{ if and (isset .Site.Params "episode_number_style") (.Params.episode) }}
            {{ if eq .Site.Params.episode_number_style "parens" }}
              <title>{{ title .Title }} ({{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }})</title>
            {{ else if eq .Site.Params.episode_number_style "brackets" }}
              <title>{{ title .Title }} [{{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}]</title>
            {{ else if eq .Site.Params.episode_number_style "dash" }}
              <title>{{ title .Title }} - {{ with .Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ .Params.episode }}</title>
            {{ else }}
              <title>{{ title .Title }}</title>
            {{ end }}
          {{ else }}
            <title>{{ title .Title }}</title>
          {{ end }}
          <link>{{ .Permalink }}</link>
          <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} </pubDate>
          <dc:creator>{{ .Site.Params.itunes_author }}</dc:creator>
          <guid>{{- if isset .Params "guid" -}}{{ .Params.guid }}{{- else -}}{{ .Site.Params.media_prefix }}{{ .Params.podcast_file }}{{- end -}}</guid>
          <itunes:author>
          {{- if isset .Params "hosts" -}}
            {{ $hosts := (.Params.hosts) }}
            {{ $len := (len $hosts) }}
            {{ range $index, $element := $hosts }}
              {{ range where (where $.Site.Pages "Type" "host" ) ".File.BaseFileName" "=" . }}
                {{- if eq $len 1 -}}
                  {{ .Title }}
                {{- else -}}
                  {{- if eq (add $index 1) $len }}
                    and {{ .Title }}
                  {{- else -}}
                    {{- if eq $len 2 -}}
                      {{ printf "%s " .Title }}
                    {{- else -}}
                      {{ printf "%s, " .Title }}
                    {{- end -}}
                  {{- end -}}
                {{- end -}}
              {{ end }}
            {{- end -}}
          {{- else -}}
            {{ .Site.Params.feed.itunes_author }}
          {{- end -}}
          </itunes:author>
          {{ with .Params.episode }}
          <itunes:episode>{{ . }}</itunes:episode>
          {{ end }}
        <itunes:title>{{ title .Title }}</itunes:title>
        {{"<itunes:subtitle><![CDATA[" | safeHTML }}
        {{ with .Params.subtitle }}
        {{ . | plainify | truncate 243 "..." }}
        {{ else }}
        {{ .Description | plainify | truncate 243 "..." }}
        {{ end }}
        {{"]]></itunes:subtitle>" | safeHTML}}
        <itunes:summary>{{ .Description | plainify }}</itunes:summary>
        <description>{{ .Description  | plainify  }}</description>
        <googleplay:description>{{ .Description  | plainify }}</googleplay:description>
        {{ "<content:encoded><![CDATA[" | safeHTML }}{{ .Content | safeHTML }}{{"]]></content:encoded>" | safeHTML}}
          {{- with .Params.episode_image -}}
          <itunes:image href="{{ . | absURL }}"></itunes:image>
          <googleplay:image href="{{ . | absURL }}"></googleplay:image>
          {{- end -}}
          <enclosure url="{{ .Site.Params.media_prefix }}{{ .Params.podcast_file }}" {{with .Params.podcast_bytes}}length="{{ . }}"{{ end }} type="audio/mpeg" />
          {{- with .Params.podcast_duration -}}<itunes:duration>{{ . }}</itunes:duration>{{- end -}}
          {{- with .Params.explicit -}}
          <itunes:explicit>{{ if (or (eq . "yes") (eq . "true")) }}true{{ else }}false{{ end }}</itunes:explicit>
          <googleplay:explicit>{{ if (or (eq . "yes") (eq . "true")) }}yes{{ else }}no{{ end }}</googleplay:explicit>
          {{- end -}}
        </item>
      {{- end -}}
    {{- end -}}
  </channel>
</rss>