Skip to content

Commit 9360525

Browse files
committed
Add Atom and RSS feeds
1 parent e336201 commit 9360525

5 files changed

Lines changed: 40 additions & 3 deletions

File tree

config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# title = ""
2-
# zola_version = 0.19.2
2+
# zola_version = 0.21.0
33
base_url = "https://mbuffa.github.io"
4+
author = "mbuffa@users.noreply.github.com (Maxime Buffa)"
45
compile_sass = true
56
generate_feeds = true
7+
feed_filenames = ["atom.xml", "rss.xml"]
68
build_search_index = true
79

810
taxonomies = [

templates/_layout.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
<link class="stylesheet" rel="stylesheet" href="/main.css" />
3434
<link class="stylesheet" rel="stylesheet" href="/dark.css" />
3535

36+
{% block atom %}
37+
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
38+
{% endblock %}
39+
40+
{% block rss %}
41+
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
42+
{% endblock %}
43+
3644
<meta name="description" content="{{ meta_description }}" />
3745
</head>
3846

templates/articles/_articles.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ <h1 class="m-2 p-2 inline-block font-bold text-2xl">{{ title }}</h1>
1111
<p class="m-2 p-2 inline-block font-normal dark:text-white text-black">
1212
{{ subtitle }}
1313
</p>
14+
<p class="m-2 p-2">
15+
<a href="/atom.xml"
16+
class="inline-block text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
17+
title="Subscribe to Atom feed">
18+
Atom
19+
</a>
20+
<span class="text-white">&middot;</span>
21+
<a href="/rss.xml"
22+
class="inline-block text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
23+
title="Subscribe to RSS feed">
24+
RSS
25+
</a>
26+
</p>
27+
1428
</th>
1529
<th></th>
1630
</tr>

templates/articles/article.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ <h1 class="text-2xl font-bold m-2 p-2">
2626
{% if page.taxonomies["tags"] %}
2727
{{ tags::tags(terms=page.taxonomies["tags"]) }}
2828
{% endif %}
29+
<p class="m-2 p-2">
30+
<a href="/atom.xml"
31+
class="text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
32+
title="Subscribe to Atom feed">
33+
Atom Feed
34+
</a>
35+
<span>&middot;</span>
36+
<a href="/rss.xml"
37+
class="text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
38+
title="Subscribe to RSS feed">
39+
RSS Feed
40+
</a>
41+
</p>
2942
</header>
3043

3144
{% if page.extra.wasm is defined %}

templates/tags/single.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{% import "articles/_articles.html" as macros %}
33

44
{% block content %}
5-
{% set term_title = "Pages tagged with '" ~ term.name ~ "'" %}
6-
{{ macros::articles_list(title=term_title, subtitle="", list=term.pages) }}
5+
{% set term_title = "Pages tagged with '" ~ term.name ~ "'" %}
6+
{{ macros::articles_list(title=term_title, subtitle="", list=term.pages) }}
77
{% endblock content %}

0 commit comments

Comments
 (0)