Improve feed logic

This commit is contained in:
daudix
2024-09-29 02:35:51 +03:00
parent 14fc52f8a1
commit 6b19540347
2 changed files with 11 additions and 7 deletions

View File

@ -6,5 +6,5 @@
{%- set card = resize_image(path=page.colocated_path ~ page.extra.banner, width=1200, height=628, op="fill") -%}
{{ card.url }}
{%- else -%}
{{ get_url(path='card.png') }}
{{ get_url(path="card.png") }}
{%- endif -%}

View File

@ -26,12 +26,16 @@
{%- include "partials/favicon.html" %}
{%- if config.generate_feeds and config.feed_filenames %}
{%- for feed in config.feed_filenames %}
<link rel="alternate" type={% if feed == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=feed) | safe }}" />
{%- endfor %}
{%- elif config.generate_feeds and config.feed_filenames | length > 0 %}
<link rel="alternate" type={% if config.feed_filenames[0] == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filenames[0]) | safe }}" />
{%- endif %}
{% for feed in config.feed_filenames %}
{% if feed == "atom.xml" %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} - Atom Feed" href="{{ get_url(path=feed) | safe }}">
{% elif feed == "rss.xml" %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} - RSS Feed" href="{{ get_url(path=feed) | safe }}">
{% else %}
<link rel="alternate" href="{{ get_url(path=feed) | safe }}">
{% endif %}
{% endfor %}
{% endif %}
{%- include "partials/variables.html" %}