Skip to content
Snippets Groups Projects
Select Git revision
  • 522891b670d1c8952742eb263d7a9d153f463bd6
  • master default protected
2 results

feed.twig

Blame
  • David Beniamine's avatar
    076adb5b
    History
    feed.twig 1.10 KiB
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      {% set RFC822 = "D, d M Y H:i:s O" %}
      <channel>
        <title>{{ site_title | e }}</title>
        <description>{{ pages.index.meta.description | e }}</description>
        <link>{{ base_url }}/</link>
        <atom:link href="{{ base_url ~ "/feed" }}" rel="self" type="application/rss+xml"/>
        <pubDate>{{ "now" | date(RFC822) }}</pubDate>
        <lastBuildDate>{{ "now" | date(RFC822) }}</lastBuildDate>
        <generator>Pico</generator>
        <!-- todo : limit to blog -->
        {% for page in pages if page.id not in ['index','feed'] and not end %}
          <item>
            <title>{{ page.title | e }}</title>
            <description>{{ page.id | content | e }}</description>
            <pubDate>{{ page.date | date(RFC822) }}</pubDate>
            <link>{{ page.url }}</link>
            <guid isPermaLink="true">{{ page.url }}</guid>
            {% for cat in page.meta.categories %}
              <category>{{ cat | e }}</category>
            {% endfor %}
          </item>
          {% if loop.index == 10 %}{% set end = true %}{% endif %}
        {% endfor %}
      </channel>
    </rss>