aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3
diff options
context:
space:
mode:
authorJustin Mayer <entroP@gmail.com>2019-01-21 09:43:34 +0100
committerGitHub <noreply@github.com>2019-01-21 09:43:34 +0100
commit8f2a03c1a3afd22ad418a70f1406cd43382be953 (patch)
tree9513dbd8834e7be0cae0b713a66964232bc559aa /pelican-bootstrap3
parentb0d1a0b1facf05805e09c7e7994ca225cd55bcea (diff)
parentbe0a4105c4e748b9abe91893544a5362d8a23772 (diff)
downloadpelican-themes-8f2a03c1a3afd22ad418a70f1406cd43382be953.tar.gz
Merge pull request #633 from pedrohdz/feed_slugs
pelican-bootstrap3: Handle Pelican >= 4.0 slugs in feeds
Diffstat (limited to 'pelican-bootstrap3')
-rw-r--r--pelican-bootstrap3/templates/base.html23
1 files changed, 16 insertions, 7 deletions
diff --git a/pelican-bootstrap3/templates/base.html b/pelican-bootstrap3/templates/base.html
index c80d84b..af2f0f9 100644
--- a/pelican-bootstrap3/templates/base.html
+++ b/pelican-bootstrap3/templates/base.html
@@ -94,15 +94,24 @@
title="{{ SITENAME }} RSS Feed"/>
{% endif %}
- {% if tag and TAG_FEED_ATOM %}
- <link href="{{ SITEURL }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate"
+ {%- if tag and TAG_FEED_ATOM %}
+ {%- if '%s' not in TAG_FEED_ATOM %}
+ {%- set tag_feed_atom = TAG_FEED_ATOM.format(slug=tag.slug) %}
+ {%- else %}
+ {%- set tag_feed_atom = TAG_FEED_ATOM.format(tag.slug) %}
+ {%- endif %}
+ <link href="{{ SITEURL }}/{{ tag_feed_atom }}" type="application/atom+xml" rel="alternate"
title="{{ SITENAME }} {{ tag }} ATOM Feed"/>
- {% endif %}
-
- {% if category and CATEGORY_FEED_ATOM %}
- <link href="{{ SITEURL }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate"
+ {%- endif %}
+ {%- if category and CATEGORY_FEED_ATOM %}
+ {%- if '%s' not in CATEGORY_FEED_ATOM %}
+ {%- set category_feed_atom = CATEGORY_FEED_ATOM.format(slug=category.slug) %}
+ {%- else %}
+ {%- set category_feed_atom = CATEGORY_FEED_ATOM.format(category.slug) %}
+ {%- endif %}
+ <link href="{{ SITEURL }}/{{ category_feed_atom }}" type="application/atom+xml" rel="alternate"
title="{{ SITENAME }} {{ category }} ATOM Feed"/>
- {% endif %}
+ {%- endif %}
</head>
<body>