Skip to content

Instantly share code, notes, and snippets.

@ironfroggy
Created February 29, 2012 01:52
Show Gist options
  • Save ironfroggy/1936902 to your computer and use it in GitHub Desktop.
Save ironfroggy/1936902 to your computer and use it in GitHub Desktop.
{% from "macros.j2" import render_excerpt, render_post with context %}
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>
{% block title %}{{ resource.meta.title|default(feed_title) }}{% endblock %}
</title>
{% block self_url %}
<link href="{{ resource.url }}" rel="self" />
{% endblock %}
{% block site_url %}
<link href="{{ content_url('') }}"/>
{% endblock %}
{% block feed_extra %}
{% endblock %}
<updated>{{ time_now|xmldatetime }}</updated>
<id>{{ content_url(resource.url) }}/</id>
{% for res in resource.node.walk_resources_sorted_by_time() %}
{% if res.meta.status == 'published' %}
<entry>
<title type="html">{{ res.meta.title }}</title>
<author><name>{{ res.meta.author }}</name></author>
<link href="{{ content_url(res.url) }}"/>
<updated>{{ res.meta.created|xmldatetime }}</updated>
<published>{{ res.meta.created|xmldatetime }}</published>
<id>{{ content_url(res.url) }}</id>
{% for tag in res.meta.tags %}
<category scheme="{{ content_url('blog/tags') }}"
term="{{tag}}"
label="{{ tag|title }}" />
{% endfor %}
<content type="html">
{% refer to res.url as article -%}
{% filter forceescape -%}
{% if resource.meta.excerpts_only -%}
{{ article.image|markdown|typogrify }}
{{ article.excerpt|markdown|typogrify }}
{%- else %}
{{ article.post|markdown|typogrify }}
{%- endif %}
{%- endfilter %}
</content>
</entry>
{% endif %}
{% endfor %}
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment