aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2019-08-05 10:32:37 +0200
committerSébastien Dailly <sebastien@chimrod.com>2019-08-05 10:32:37 +0200
commit770ef6ab748ec6070a7eb2eec8626dc5338d6fd5 (patch)
treebec9b2ae2d62a576602c3a62f4e99a07522d3ed9
parent5fbaa084647548e60f9a037096ecbb84a8c84e90 (diff)
Switch to pelican4.1
-rw-r--r--.gitignore1
-rwxr-xr-xpelicanconf.py5
-rwxr-xr-xtheme/templates/base.html9
-rwxr-xr-xtheme/templates/categories.html2
-rwxr-xr-xtheme/templates/category.html8
-rwxr-xr-xtheme/templates/tag.html4
6 files changed, 11 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index 24ecff8..15d7067 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ cache/
*.pyc
*.swp
*.pid
+*~
diff --git a/pelicanconf.py b/pelicanconf.py
index 57a0940..9e4ca35 100755
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -23,8 +23,9 @@ FEED_DOMAIN = SITEURL
FEED_RSS = 'feed'
FEED_ATOM = 'feeds/atom.xml'
FEED_MAX_ITEMS=5
-TAG_FEED_RSS = 'feeds/%s.xml'
-TAG_FEED_ATOM = 'feeds/%s.atom'
+TAG_FEED_RSS = 'feeds/{slug}.xml'
+TAG_FEED_ATOM = 'feeds/{slug}.atom.xml'
+CATEGORY_FEED_RSS = 'feeds/{slug}.rss.xml'
DEFAULT_PAGINATION = FEED_MAX_ITEMS
diff --git a/theme/templates/base.html b/theme/templates/base.html
index 7024c58..6f44bb4 100755
--- a/theme/templates/base.html
+++ b/theme/templates/base.html
@@ -8,19 +8,18 @@
<link href="{{ SITEURL }}/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} - Flux ATOM" />
{% if tag %}
{% if TAG_FEED_ATOM %}
- <link href="{{ SITEURL }}/{{ TAG_FEED_ATOM % tag|e|lower }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} » {{ tag|e }} - Flux ATOM" />
+ <link href="{{ SITEURL }}/{{ TAG_FEED_ATOM.format(slug = tag|e|lower) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} » {{ tag|e }} - Flux ATOM" />
{% endif %}
{% if TAG_FEED_RSS %}
- <link href="{{ SITEURL }}/{{ TAG_FEED_RSS % tag|e|lower }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} » {{ tag }} - Flux RSS" />
+ <link href="{{ SITEURL }}/{{ TAG_FEED_RSS.format(slug = tag|e|lower) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} » {{ tag }} - Flux RSS" />
{% endif %}
{% endif %}
-
{% if category %}
{% if CATEGORY_FEED_ATOM %}
- <link href="{{ SITEURL }}/{{ CATEGORY_FEED_ATOM % category|lower }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} » {{ category|e }} - Flux ATOM" />
+ <link href="{{ SITEURL }}/{{ CATEGORY_FEED_ATOM.format(slug = category|lower) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} » {{ category|e }} - Flux ATOM" />
{% endif %}
{% if CATEGORY_FEED_RSS %}
- <link href="{{ SITEURL }}/{{ CATEGORY_FEED_RSS % category|lower }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} » {{ category|e }} - Flux RSS" />
+ <link href="{{ SITEURL }}/{{ CATEGORY_FEED_RSS.format(slug = category|lower) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} » {{ category|e }} - Flux RSS" />
{% endif %}
{% endif %}
diff --git a/theme/templates/categories.html b/theme/templates/categories.html
index 0cd25d4..b63eef8 100755
--- a/theme/templates/categories.html
+++ b/theme/templates/categories.html
@@ -9,7 +9,7 @@
<li>
<a href="{{ category.url }}">{{ category }}</a> ({{ articles|count }})
{% if CATEGORY_FEED_RSS %}
- <a href="{{ SITEURL }}/{{ CATEGORY_FEED_RSS % category }}" ><img src="theme/images/rss.png" /></a>
+ <a href="{{ SITEURL }}/{{ CATEGORY_FEED_RSS.format(slug=category) }}" ><img src="theme/images/rss.png" /></a>
{% endif %}
</li>
{% endfor %}
diff --git a/theme/templates/category.html b/theme/templates/category.html
index 30284ca..f00be70 100755
--- a/theme/templates/category.html
+++ b/theme/templates/category.html
@@ -8,12 +8,4 @@
{{ abstract.abstract("h2") }}
{% endif %}
- {% if CATEGORY_FEED_RSS %}
- <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS % category|e|lower}}" ><img src="../theme/images/rss.png" /></a>
- {% endif %}
-
- {% if CATEGORY_FEED_ATOM %}
- <a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM % category|e|lower}}" ><img src="../theme/images/atom.png" /></a>
- {% endif %}
-
{% endblock %}
diff --git a/theme/templates/tag.html b/theme/templates/tag.html
index 496d0e6..dbe2d82 100755
--- a/theme/templates/tag.html
+++ b/theme/templates/tag.html
@@ -9,11 +9,11 @@
{% endif %}
{% if TAG_FEED_RSS %}
- <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS % page_name|replace("tag/", "")|e|lower}}" ><img src="../theme/images/rss.png" /></a>
+ <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS.format(slug = page_name|replace("tag/", "")|e|lower)}}" ><img src="../theme/images/rss.png" /></a>
{% endif %}
{% if TAG_FEED_ATOM %}
- <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM % page_name|replace("tag/", "")|e|lower}}" ><img src="../theme/images/atom.png" /></a>
+ <a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM.format(slug = page_name|replace("tag/", "")|e|lower)}}" ><img src="../theme/images/atom.png" /></a>
{% endif %}
{% endblock %}