Fix feeds href everywhere

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'
This commit is contained in:
Arnaud Rebillout
2020-07-26 10:14:17 +07:00
parent c688953bc0
commit 43c9c419c0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -34,8 +34,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js" crossorigin="anonymous"></script>
{% endif %}
<!-- Atom feed -->
<link rel="alternate" type="application/atom+xml" title="{{ SITENAME }} (Feed)" href="{{ FEED_ALL_ATOM }}" />
<!-- Feeds -->
<link rel="alternate" type="application/atom+xml" title="{{ SITENAME }} (Feed)" href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" />
<!-- Analytics -->
{% include 'fragments/google_analytics.html' %}