aboutsummaryrefslogtreecommitdiff
path: root/_includes/feed.atom
blob: 6ea84b3a5d47a127c41c3d8bf20f33ce05eb9c17 (about) (plain) (blame)
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
{% assign
    is_audio=site.atom[include.kind].audio
%}{% assign
    is_video=site.atom[include.kind].video
%}<?xml version="1.0" encoding="UTF-8"?>
  {% if is_audio or is_video %}
    <rss version="2.0"
         xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>{{ site.title | smartify | xml_escape }}</title>
        <description>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</description>
        <link>{{ page.url | absolute_url | xml_escape }}</link>
        <atom:link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" />
        <language>{{ include.lang }}</language>
        <copyright>CC BY-SA 4.0</copyright>

        <lastBuildDate>{{ site.time | date_to_xmlschema }}</lastBuildDate>
        <docs>http://blogs.law.harvard.edu/tech/rss</docs>

        <author>{{ site.author.name | xml_escape }} 3</author>
        <webMaster>{{ site.author.email | xml_escape }} ({{ site.author.name | xml_escape }})</webMaster>
        <image>
          <url>{{ '/' | absolute_url | xml_escape }}static/lord-favicon.png</url>
          <link>{{ page.url | absolute_url | xml_escape }}</link>
          <title>{{ site.t[include.kind].feed.title[include.lang] }}</title>
        </image>
  {% else %}
    <feed
        xmlns="http://www.w3.org/2005/Atom"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xml:lang="{{ include.lang }}">
      <link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" />
      <link href="{{ '/' | absolute_url | xml_escape }}" rel="alternate" type="text/html" hreflang="{{ include.lang }}" />
      <title>{{ site.title | xml_escape }}</title>
      <subtitle>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</subtitle>
      <id>{{ page.url | absolute_url | xml_escape }}</id>
      <updated>{{ site.time | date_to_xmlschema }}</updated>

      <author>
        <name>{{ site.author.name | xml_escape }}</name>
        <email>{{ site.author.email | xml_escape }}</email>
      </author>
  {% endif %}

  {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %}
  {% for entry in entries %}
    {% if is_audio or is_video %}
      <item>
        <title>{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
        <link>{{ entry.url | absolute_url | xml_escape }}</link>
        <guid>{{ entry.url | absolute_url | xml_escape }}</guid>
        <description xml:base="{{ entry.url | absolute_url | xml_escape }}">
          {{ entry.content | strip | xml_escape }}
        </description>
        {% if is_audio %}
          <enclosure url="{{ entry.url | replace: ".html", ".ogg"         | absolute_url | xml_escape }}" type="audio/ogg" />
        {% elsif is_video %}
          <enclosure url="{{ entry.url | replace: ".html", ".webm.torrent" | absolute_url | xml_escape }}" type="application/x-bittorrent" />
        {% endif %}
        <category>EuAndreh</category>
        <pubDate>{{ entry.date | date_to_xmlschema }}</pubDate>
      </item>
    {% else %}
      <entry xml:lang="{{ entry.lang }}">
        <title type="html">{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
        <link href="{{ entry.url | absolute_url | xml_escape }}" rel="alternate" type="text/html" title="{{ entry.title | xml_escape }}" />
        <published>{{ entry.date | date_to_xmlschema }}</published>
        <updated>{{ entry.updated_at | default: entry.date | date_to_xmlschema }}</updated>
        <id>{{ entry.url | absolute_url | xml_escape }}</id>

        <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}">
          {{ entry.content | strip | xml_escape }}
        </content>

        <author>
          <name>{{ site.author.name | xml_escape }}</name>
          <email>{{ site.author.email | xml_escape }}</email>
        </author>

        <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
      </entry>
    {% endif %}
  {% endfor %}

{% if is_audio or is_video %}
    </channel>
  </rss>
{% else %}
  </feed>
{% endif %}