Skip to content

Commit

Permalink
Merge pull request #71 from heitorPB/feeds
Browse files Browse the repository at this point in the history
templates/index: fix broken RSS/ATOM feed rel links
  • Loading branch information
pawroman authored Aug 17, 2024
2 parents c620187 + d0bb9da commit dbef3fa
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@

{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}

{%- if config.generate_feed %}
{%- if "rss" in config.feed_filename %}
{% set feed_type = 'rss+xml' %}
{%- else %}
{% set feed_type = 'atom+xml' %}
{% endif -%}
<link rel="alternate" type="application/{{ feed_type }}" title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{%- if config.generate_feeds %}
{%- for feed in config.feed_filenames %}
{%- if feed is containing('atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- if feed is containing('rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- endfor %}
{% endif -%}

{%- if config.extra.favicon %}
Expand Down

0 comments on commit dbef3fa

Please sign in to comment.