From 43c9c419c08ed170104557e1d62fe42f36bcbc29 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 10:14:17 +0700 Subject: [PATCH] Fix feeds href everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per https://docs.getpelican.com/en/stable/settings.html#feed-settings: FEED_DOMAIN = None, i.e. base URL is "/" The domain prepended to feed URLs. Since feed URLs should always be absolute, it is highly recommended to define this (e.g., “https://feeds.example.com”). If you have already explicitly defined SITEURL (see above) and want to use the same domain for your feeds, you can just set: FEED_DOMAIN = SITEURL. Using `href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}"` in the template seems to be the right way to do things, by looking at other themes, eg the default theme in Pelican itself: https://github.com/getpelican/pelican/blob/master/pelican/themes/simple/templates/base.html Obviously, this change might break things for some users of the theme. If someone used to have this definition in `publishconf.py`: FEED_ALL_ATOM = SITEURL + '/feeds/all.atom.xml' Then they should update to: FEED_DOMAIN = SITEURL FEED_ALL_ATOM = 'feeds/all.atom.xml' --- templates/base.html | 4 ++-- templates/sidebar.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/base.html b/templates/base.html index 5a140c8..8fd03a8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -34,8 +34,8 @@ {% endif %} - - + + {% include 'fragments/google_analytics.html' %} diff --git a/templates/sidebar.html b/templates/sidebar.html index 858e294..0ce5798 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -35,7 +35,7 @@ {% endif %} {% endfor %} - +