Mercurial > piecrust2
diff piecrust/resources/prepare/rss.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 | c3c1171679de |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piecrust/resources/prepare/rss.html Sun Aug 10 23:43:16 2014 -0700 @@ -0,0 +1,60 @@ +--- +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"?> +<rss version="2.0" + xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:content="http://purl.org/rss/1.0/modules/content/" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <channel> + <title>{{site.title}}</title> + <link>{{site.root}}</link> + <atom:link href="{{page.url}}" rel="self" type="application/rss+xml" /> + {% if page.description %} + <description>{{page.description}}</description> + {% else %} + <description>Latest news from {{site.title}}</description> + {% endif %} + <lastBuildDate>{{now|date("r")}}</lastBuildDate> + <pubDate>{{now|date("r")}}</pubDate> + <generator>PieCrust {{piecrust.version}}</generator> + {% if page.language %}<language>{{page.language}}</language>{% endif %} + {% for c in page.categories %} + <category>{{c}}</category> + {% endfor %} + {% if page.ttl %}<ttl>{{page.ttl}}</ttl>{% endif %} + + {% for post in blog.posts.limit(page.post_count) %} + {% set author = site.author %} + {% if post.author %}{% set author = post.author %}{% endif %} + <item> + <title>{{post.title}}</title> + <link>{{post.url}}</link> + {% if author %} + <author>{{author}}</author> + <dc:creator>{{author}}</dc:creator> + {% endif %} + {% if post.category %}<category>{{post.category}}</category>{% endif %} + {% for t in post.tags %} + <category>{{t}}</category> + {% endfor %} + <pubDate>{{post.timestamp|date("r")}}</pubDate> + <guid>{{post.url}}</guid> + <description>{{post.content}} + {% if post.has_more and page.read_more_text %} + {{ ("<a href=\"" ~ post.url ~ "\">" ~ page.read_more_text ~ "</a>")|escape }} + {% endif %} + </description> + </item> + {% endfor %} + + </channel> +</rss>