Skip to content

Commit 12babae

Browse files
committed
Devlog article pages don't link to Atom feed
1 parent 51179c6 commit 12babae

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

website/templates/layout.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,22 @@
9191
<meta name="twitter:description" content="{{ c_page_summary }}">
9292
<meta name="twitter:image" content="{{ c_page_image | safe }}">
9393

94-
{% if section and section.generate_feeds %}
95-
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ current_path | safe }}atom.xml">
94+
{%- set c_is_section_with_feed = (section and section.generate_feeds) -%}
95+
96+
{% if page %}
97+
{%- set c_parent_section = get_section(path=page.ancestors | last, metadata_only=true) -%}
98+
{%- set c_is_page_in_feed = c_parent_section | get(key="generate_feeds") -%}
99+
{% else %}
100+
{%- set c_is_page_in_feed = false -%}
101+
{% endif %}
102+
103+
{% if c_is_section_with_feed or c_is_page_in_feed %}
104+
{% if c_is_section_with_feed %}
105+
{%- set c_feed_path = section.path -%}
106+
{% else %}
107+
{%- set c_feed_path = c_parent_section.path -%}
108+
{% endif %}
109+
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ c_feed_path | safe }}atom.xml">
96110
{% endif %}
97111
</head>
98112
<body class="body-background dark:body-background flex flex-col h-screen justify-between">

0 commit comments

Comments
 (0)