Mercurial > piecrust2
diff piecrust/resources/prepare/atom.html @ 3:f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
- Serving works, with debug window.
- Baking works, multi-threading, with dependency handling.
- Various things not implemented yet.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 10 Aug 2014 23:43:16 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piecrust/resources/prepare/atom.html Sun Aug 10 23:43:16 2014 -0700 @@ -0,0 +1,48 @@ +--- +description: +read_more_text: "Read more..." +language: +categories: +ttl: +layout: none +format: none +post_count: 10 +content_type: xml +--- +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>{{site.title}}</title> + {% if page.description %} + <subtitle>{{page.description}}</subtitle> + {% else %} + <subtitle>Latest news from {{site.title}}</subtitle> + {% endif %} + <link href="{{page.url}}" rel="self" /> + <link href="{{site.root}}" /> + <id>{{site.root}}</id> + <updated>{{now|atomdate}}</updated> + + {% for post in blog.posts.limit(page.post_count) %} + {% set author = site.author %} + {% if post.author %}{% set author = post.author %}{% endif %} + {% if not author %}{{pcfail("Atom feeds require an author for each post. You can specify a global author with the 'site.author' config.")}}{% endif %} + <entry> + <title>{{post.title}}</title> + <link href="{{post.url}}" /> + <link rel="alternate" type="text/html" href="{{post.url}}"/> + <id>{{post.url}}</id> + <updated>{{post.timestamp|atomdate}}</updated> + <content type="html">{{post.content}} + {% if post.has_more and page.read_more_text %} + {{ ("<a href=\"" ~ post.url ~ "\">" ~ page.read_more_text ~ "</a>")|escape }} + {% endif %} + </content> + {% if author %} + <author> + <name>{{author}}</name> + </author> + {% endif %} + </entry> + {% endfor %} + +</feed>