update: support multiple feed filenames in config and templates
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
5265b6d5cc
commit
ea27453685
3 changed files with 12 additions and 5 deletions
|
|
@ -16,8 +16,8 @@ taxonomies = [
|
||||||
{name = "tags", feed = true, paginate_by=10},
|
{name = "tags", feed = true, paginate_by=10},
|
||||||
]
|
]
|
||||||
|
|
||||||
generate_feed = true
|
generate_feeds = true
|
||||||
feed_filename = "rss.xml"
|
feed_filenames = ["rss.xml"]
|
||||||
|
|
||||||
[search] # Options specific to elasticlunr search.
|
[search] # Options specific to elasticlunr search.
|
||||||
# index format can be: elasticlunr_json or elasticlunr_javascript
|
# index format can be: elasticlunr_json or elasticlunr_javascript
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,11 @@
|
||||||
<head>
|
<head>
|
||||||
{%- include "partials/head.html" %}
|
{%- include "partials/head.html" %}
|
||||||
|
|
||||||
{#- Rss / Atom Feed #}
|
{#- Rss / Atom Feed - using new feed_filenames config #}
|
||||||
{%- block rss %}
|
{%- block rss %}
|
||||||
{%- if config.generate_feed %}
|
{%- if config.generate_feeds %}
|
||||||
<link rel="alternate" type="{% if config.feed_filename is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="{{ config.title }} Atom/RSS Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false, lang=lang) | safe }}" />
|
{%- set feed_file = config.feed_filenames | first %}
|
||||||
|
<link rel="alternate" type="{% if feed_file is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="{{ config.title }} Atom/RSS Feed" href="{{ get_url(path=feed_file, trailing_slash=false, lang=lang) | safe }}" />
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- endblock rss %}
|
{%- endblock rss %}
|
||||||
|
|
|
||||||
|
|
@ -115,4 +115,10 @@
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
{#- Rss / Atom Feed - using new feed_filenames config #}
|
||||||
|
{%- if config.generate_feeds %}
|
||||||
|
{%- set feed_file = config.feed_filenames | first %}
|
||||||
|
<link rel="alternate" type="{% if feed_file is containing('atom') %}application/atom+xml{% else %}application/rss+xml{% endif %}" title="{{ config.title }} Atom/RSS Feed" href="{{ get_url(path=feed_file, trailing_slash=false, lang=lang) | safe }}" />
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{#- End of head partial -#}
|
{#- End of head partial -#}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue