chiark / gitweb /
theme: use the {slug} instead of %s for feed URL templates.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 26 Nov 2018 12:15:51 +0000 (13:15 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 26 Nov 2018 13:53:01 +0000 (14:53 +0100)
And thus dropping Pelican 3.7 support here as well.

pelican-theme/templates/base.html
pelican-theme/test/test_blog.py

index 89ca00ebfd7ebe2ce5b7a4b1e31284fa0e9358b4..9c6d1e67b51ffacef0fcc9a51a2ae96631dd543e 100644 (file)
@@ -15,9 +15,9 @@
   {% endif %}
   {% if category %}
   {% if CATEGORY_FEED_ATOM_URL %}
-  <link href="{{ CATEGORY_FEED_ATOM_URL|format(category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
+  <link href="{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
   {% elif CATEGORY_FEED_ATOM %}
-  <link href="{{ CATEGORY_FEED_ATOM|format(category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
+  <link href="{{ CATEGORY_FEED_ATOM.format(slug=category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
   {% endif %}
   {% endif %}
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
index 907329d0de882ef16f28e2d855f6ce6c51e50f22..63dc102b045c748aaece3cbbc937dc105d18625a 100644 (file)
@@ -560,8 +560,8 @@ class Feeds(BlogTestCase):
             'M_DISABLE_SOCIAL_META_TAGS': True,
             'FEED_ALL_ATOM': 'atom.xml',
             'FEED_ALL_ATOM_URL': 'feeds/atom.xml',
-            'CATEGORY_FEED_ATOM': '%s.atom.xml',
-            'CATEGORY_FEED_ATOM_URL': 'feeds/%s.atom.xml',
+            'CATEGORY_FEED_ATOM': '{slug}.atom.xml',
+            'CATEGORY_FEED_ATOM_URL': 'feeds/{slug}.atom.xml',
         })
 
         # There should be just the first column
@@ -576,7 +576,7 @@ class FeedsNoUrl(BlogTestCase):
         self.run_pelican({
             'M_DISABLE_SOCIAL_META_TAGS': True,
             'FEED_ALL_ATOM': 'feeds/atom.xml',
-            'CATEGORY_FEED_ATOM': 'feeds/%s.atom.xml',
+            'CATEGORY_FEED_ATOM': 'feeds/{slug}.atom.xml',
         })
 
         # The feed URLs should be the same as above