|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<rss xmlns:atom="http://www.w3.org/2005/Atom" |
| 3 | + xmlns:content="http://purl.org/rss/1.0/modules/content/" |
| 4 | + xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> |
| 5 | + <channel> |
| 6 | + <title> |
| 7 | + {{ config.title }} |
| 8 | + {%- if term %} - {{ term.name }} |
| 9 | + {%- elif section.title %} - {{ section.title }} |
| 10 | + {%- endif -%} |
| 11 | + </title> |
| 12 | + <link> |
| 13 | + {%- if section -%} |
| 14 | + {{ section.permalink | escape_xml | safe }} |
| 15 | + {%- else -%} |
| 16 | + {{ config.base_url | escape_xml | safe }} |
| 17 | + {%- endif -%} |
| 18 | + </link> |
| 19 | + <description>{{ config.description }}</description> |
| 20 | + <generator>Zola</generator> |
| 21 | + <language>{{ lang }}</language> |
| 22 | + <atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/> |
| 23 | + |
| 24 | + {% if last_updated is defined %} |
| 25 | + <lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate> |
| 26 | + {% endif %} |
| 27 | + |
| 28 | + {%- for page in pages %} |
| 29 | + <item> |
| 30 | + <title>{{ page.title | escape_xml }}</title> |
| 31 | + <pubDate>{{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</pubDate> |
| 32 | + <link>{{ page.permalink | escape_xml | safe }}</link> |
| 33 | + <guid isPermaLink="true">{{ page.permalink | escape_xml | safe }}</guid> |
| 34 | + <description xml:base="{{ page.permalink | escape_xml | safe }}"> |
| 35 | + <![CDATA[{{ page.summary | default(value=page.title) }}]]> |
| 36 | + </description> |
| 37 | + <content:encoded> |
| 38 | + {# |
| 39 | + first replace transforms internal links to permalink. |
| 40 | + second one replaces relative link to parent path. it only does 1 level. |
| 41 | + #} |
| 42 | + {% set base = page.components | slice(end=-1) | join(sep='/') %} |
| 43 | + <![CDATA[{{ |
| 44 | + page.content |
| 45 | + | replace(from='href="#', to='href="' ~ page.permalink ~ '#') |
| 46 | + | replace(from='href="../', to='href="' ~ config.base_url ~ '/' ~ base ~ '/') |
| 47 | + | safe |
| 48 | + }}]]> |
| 49 | + </content:encoded> |
| 50 | + </item> |
| 51 | + {%- endfor %} |
| 52 | + </channel> |
| 53 | +</rss> |
0 commit comments