[TASK] add feed
This commit is contained in:
parent
23794ac9d3
commit
95616cc17d
29
Packages/chrosey_materialize/templates/feed.twig
Normal file
29
Packages/chrosey_materialize/templates/feed.twig
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<rss version="2.0"
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
{% set RFC822 = "D, d M Y H:i:s O" %}
|
||||||
|
<channel>
|
||||||
|
<title>{{ site_title | e }}</title>
|
||||||
|
<description>{{ pages.index.meta.description | e }}</description>
|
||||||
|
<link>{{ base_url }}/</link>
|
||||||
|
<atom:link href="{{ base_url ~ "/feed" }}"
|
||||||
|
rel="self"
|
||||||
|
type="application/rss+xml" />
|
||||||
|
<pubDate>{{ "now" | date(RFC822) }}</pubDate>
|
||||||
|
<lastBuildDate>{{ "now" | date(RFC822) }}</lastBuildDate>
|
||||||
|
<generator>Pico</generator>
|
||||||
|
{% for page in pages if page.id not in ['index','feed'] and not page.hidden and not end %}
|
||||||
|
<item>
|
||||||
|
<title>{{ page.title | e }}</title>
|
||||||
|
<description>{{ page.id | content | e }}</description>
|
||||||
|
<pubDate>{{ page.date | date(RFC822) }}</pubDate>
|
||||||
|
<link>{{ page.url }}</link>
|
||||||
|
<guid isPermaLink="true">{{ page.url }}</guid>
|
||||||
|
{% for cat in page.meta.categories %}
|
||||||
|
<category>{{ cat | e }}</category>
|
||||||
|
{% endfor %}
|
||||||
|
</item>
|
||||||
|
{% if loop.index == 10 %}{% set end = true %}{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
4
content/feed.md
Normal file
4
content/feed.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
Template: templates/feed
|
||||||
|
hidden: true
|
||||||
|
---
|
||||||
Loading…
x
Reference in New Issue
Block a user