ParkerTenBroeck.github.io/templates/macros/feed.html
Parker TenBroeck 6950c0772c improving feeds
2026-01-16 22:29:36 -05:00

10 lines
No EOL
569 B
HTML

{%- macro link_alternate(filename, title) -%}
{%- if filename is ending_with("atom.xml") -%}
{%- set type = 'type="application/atom+xml" ' -%}
{%- elif filename is ending_with("rss.xml") -%}
{%- set type = 'type="application/rss+xml" ' -%}
{%- elif filename is ending_with(".json") -%}
{%- set type = 'type="application/feed+json" ' -%}
{%- endif -%}
<link rel="alternate" {{ type | default(value="") | safe -}} href="{{ get_url(path=filename) }}" title="{{ title | replace(from='"', to="&quot;") | safe }}">
{%- endmacro -%}