fix atom feed
This commit is contained in:
parent
5d31cb4027
commit
3b6e441d48
4 changed files with 57 additions and 2 deletions
|
@ -4,8 +4,9 @@ base_url = "https://lynxize.dev"
|
|||
compile_sass = false
|
||||
build_search_index = false
|
||||
|
||||
generate_feeds = false # need to configure it to be at /blog/atom.xml which takes Work(tM)
|
||||
generate_feeds = false # set to true in the blog _index
|
||||
|
||||
author="lynxize"
|
||||
|
||||
[markdown]
|
||||
highlight_code = true
|
||||
|
|
|
@ -3,4 +3,8 @@ title = "Various Ramblings"
|
|||
sort_by = "date"
|
||||
template = "blog.html"
|
||||
page_template = "post.html"
|
||||
|
||||
generate_feeds = true
|
||||
+++
|
||||
|
||||
Some random blog posts/ramblings/text walls of mine.
|
49
templates/atom.xml
Normal file
49
templates/atom.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
|
||||
<title>{{ config.author }}</title>
|
||||
{%- if config.description %}
|
||||
<subtitle>{{ config.description }}</subtitle>
|
||||
{%- endif %}
|
||||
<link rel="self" type="application/atom+xml" href="{{ feed_url | safe }}"/>
|
||||
<link rel="alternate" type="text/html" href="
|
||||
{%- if section -%}
|
||||
{{ section.permalink | escape_xml | safe }}
|
||||
{%- else -%}
|
||||
{{ config.base_url | escape_xml | safe }}
|
||||
{%- endif -%}
|
||||
"/>
|
||||
<generator uri="https://www.getzola.org/">Zola</generator>
|
||||
<updated>{{ last_updated | date(format="%+") }}</updated>
|
||||
<id>{{ feed_url | safe }}</id>
|
||||
{%- for page in pages %}
|
||||
<entry xml:lang="{{ page.lang }}">
|
||||
<title>{{ page.title }}</title>
|
||||
<published>{{ page.date | date(format="%+") }}</published>
|
||||
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
|
||||
{% for author in page.authors %}
|
||||
<author>
|
||||
<name>
|
||||
{{ author }}
|
||||
</name>
|
||||
</author>
|
||||
{% else %}
|
||||
<author>
|
||||
<name>
|
||||
{%- if config.author -%}
|
||||
{{ config.author }}
|
||||
{%- else -%}
|
||||
Unknown
|
||||
{%- endif -%}
|
||||
</name>
|
||||
</author>
|
||||
{% endfor %}
|
||||
<link rel="alternate" type="text/html" href="{{ page.permalink | safe }}"/>
|
||||
<id>{{ page.permalink | safe }}</id>
|
||||
{% if page.summary %}
|
||||
<summary type="html">{{ page.summary }}</summary>
|
||||
{% else %}
|
||||
<content type="html" xml:base="{{ page.permalink | escape_xml | safe }}">{{ page.content }}</content>
|
||||
{% endif %}
|
||||
</entry>
|
||||
{%- endfor %}
|
||||
</feed>
|
|
@ -20,6 +20,7 @@
|
|||
<a href="/blog">blog</a>
|
||||
<a href="/stuff">stuff</a>
|
||||
</nav>
|
||||
<link rel="alternate" type="application/atom+xml" title="RSS" href="/blog/atom.xml">
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
|
|
Loading…
Add table
Reference in a new issue