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:
+2
-2
@@ -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' %}
|
||||
|
||||
Reference in New Issue
Block a user