Skip to content

Commit

Permalink
Add an ATOM feed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjl committed Jan 8, 2010
1 parent 80fbf0a commit 7e8b60d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 31 deletions.
1 change: 1 addition & 0 deletions content/feed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "skeleton/_atom.xml" %}
2 changes: 1 addition & 1 deletion layout/_splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<li>What makes me tick. &raquo;</li>
<li>Some things I’ve made. &raquo;</li>
<li>More about me. &raquo;</li>
<li>Feeds. &raquo;</li>
<li>Atom feed. &raquo;</li>
</ul>
</div>
{% endfilter %}
Expand Down
70 changes: 41 additions & 29 deletions layout/skeleton/_atom.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
{%spaceless%}

{% spaceless %}

<feed xmlns="http://www.w3.org/2005/Atom">
<title>{% block title %}{{site.name}} {{page.node.name}}{%endblock%}</title>
{%block self_url %}
<link href="{{page.node.full_url}}/atom.xml" rel="self"/>
{%endblock%}
{%block site_url %}
<link href="{{site.full_url}}"/>
{%endblock%}{%block feed_extra%}{%endblock%}
<updated>{{now|xmldatetime}}</updated>
<id>{{site.full_url}}</id>
{% for node_page in page.node.walk_pages %}
{% ifnotequal node_page page %}
{% if not node_page.listing and not node_page.exclude %}
<entry>
<title>{{node_page.title}}</title>
<author><name>Lakshmi Vyas</name></author>
<link href="{{node_page.full_url}}"/>
<updated>{{node_page.updated|default:node_page.created|xmldatetime}}</updated>
<published>{{node_page.created|xmldatetime}}</published>
<id>{{node_page.full_url}}</id>
{%block entry_extra%}{%endblock%}
<content type="html">
{%filter force_escape%}{% render_article node_page %}{%endfilter%}
</content>
</entry>
{%endif%}
{%endifnotequal%}
{% endfor %}
<title>{% block title %}{{ site.name }}{% endblock %}</title>

{% block self_url %}
<link href="{{ page.node.full_url }}/feed/" rel="self" />
{% endblock %}

{% block site_url %}
<link href="{{ site.full_url }}"/>
{% endblock %}

{% block feed_extra %}{% endblock %}

<updated>{{ now|xmldatetime }}</updated>

<id>{{ site.full_url }}/</id>

{% for node_page in page.node.walk_pages %}
{% ifnotequal node_page page %}
{% if not node_page.listing and not node_page.exclude %}
<entry>
<title type="html">{{ node_page.title }}</title>
<author><name>{{ site.author }}</name></author>
<link href="{{ node_page.full_url }}"/>
<updated>{{ node_page.created|xmldatetime }}</updated>
<published>{{ node_page.created|xmldatetime }}</published>
<id>{{ node_page.full_url }}</id>
{% block entry_extra %}{% endblock %}
<content type="html">
{% filter force_escape %}
{% render_article node_page %}
{% endfilter %}
</content>
</entry>
{%endif%}
{%endifnotequal%}
{% endfor %}
</feed>
{%endspaceless%}

{% endspaceless %}
2 changes: 1 addition & 1 deletion layout/skeleton/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>
<li><a href="http://bitbucket.org/sjl/">Code</a></li>
<li><a href="/projects">Projects</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/rss/">RSS</a></li>
<li><a href="/feed/">Feed</a></li>
</ul>
</div>

Expand Down

0 comments on commit 7e8b60d

Please sign in to comment.