Skip to content

Instantly share code, notes, and snippets.

@tankywoo
Last active December 23, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tankywoo/594c24097acddf24acd3 to your computer and use it in GitHub Desktop.
Save tankywoo/594c24097acddf24acd3 to your computer and use it in GitHub Desktop.
for simiki
<?xml version="1.0" encoding="utf-8"?>
{% if site.url %}
{% set site_url = "%s%s"|format(site.url, site.root) %}
{% else %}
{% set site_url = site.url %}
{% endif %}
<feed xmlns="http://www.w3.org/2005/Atom">
<generator uri="http://simiki.org/" version="{{ site.version }}">Simiki</generator>
<title>{{ site.title }}</title>
<link href="{{ site_url }}/" />
<link href="{{ site_url }}/atom.xml" rel="self" type="application/atom+xml" />
<updated>{{ site.time|rfc3339 }}</updated>
<id>{{ site_url }}</id>
<author>
<name>{{ site.author|e }}</name>
</author>
{% for f, page in pages.iteritems() %}
{% set uri = site_url ~ f|replace('content/', '', 1)|replace('.md', '.html', 1) %}
<entry>
<id>{{ uri }}</id>
<title>{{ page.title|e }}</title>
<link href="{{ uri }}" />
<published>{{ page.date|rfc3339 }}</published>
{% if page.updated %}
<updated>{{ page.updated|rfc3339 }}</updated>
{% else %}
<updated>{{ page.date|rfc3339 }}</updated>
{% endif %}
{% if page.category %}
<category term="{{ page.category }}" />
{% endif %}
{% if page.content %}
<content type="html">{{ page.content|e }}</content>
{% endif %}
{% if page.summary %}
<summary>{{ page.summary|e }}</summary>
{% endif %}
</entry>
{% endfor %}
</feed>
@tankywoo
Copy link
Author

tankywoo commented Dec 1, 2015

  1. jinja plugin: date_to_xmlschema ?
  2. category

@tankywoo
Copy link
Author

updated must exists, from rfc4287:

atom:entry elements MUST contain exactly one atom:updated element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment