From 34310a61f5bf33a4a33db11178769e7e6f1daacc Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 31 Mar 2012 08:10:40 -0700 Subject: [PATCH 1/2] Feed link inside feed should use FEED_DOMAIN The initial work on enabling feeds to be served from a different domain than the site domain focused on the feed link displayed inside the base template. But there is also a feed link inside the generated feed itself, which this commit updates to use the FEED_DOMAIN value (if defined). Also, it turns out that the FEED_MAIN_URL setting is not necessary; the existing FEED and FEED_RSS functionality is simpler and can address the targeted use case just as easily. That attribute has been removed from the settings and template, along with corresponding changes to the docs. Refs #177. --- docs/settings.rst | 33 +++++++++----------- pelican/settings.py | 1 - pelican/themes/notmyidea/templates/base.html | 4 +-- pelican/writers.py | 3 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 1ed36844..b7882075 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -235,11 +235,6 @@ Setting name (default value) What does it do? `TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed `FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item quantity is unrestricted by default. -`FEED_MAIN_URL` (``'feeds/all.atom.xml'``) URL appended to domain for the main Atom feed and - used to populate its `` in the base template. - Useful when you want the feed link to differ from the - filesystem path, such as when using web server - aliases/rewrites or FeedBurner (see below). ================================================ ===================================================== If you don't want to generate some of these feeds, set ``None`` to the @@ -250,21 +245,21 @@ variables above. FeedBurner ---------- -If you want to use FeedBurner for your primary Atom feed, there are two -primary fields to configure in the `FeedBurner -`_ interface: "Original Feed" and "Feed Address". -If using the default Pelican `FEED` attribute and assuming your feeds -are served from the `www.example.com` domain, you would enter -`http://www.example.com/feeds/all.atom.xml` in the "Original Feed" field in -FeedBurner. +If you want to use FeedBurner for your feed, you will likely need to decide +upon a unique identifier. For example, if your site were called "Thyme" and +hosted on the www.example.com domain, you might use "thymefeeds" as your +unique identifier, which we'll use throughout this section for illustrative +purposes. In your Pelican settings, set the `FEED` attribute to +"thymefeeds/main.xml" to create an Atom feed with an original address of +`http://www.example.com/thymefeeds/main.xml`. Set the `FEED_DOMAIN` attribute +to `http://feeds.feedburner.com`, or `http://feeds.example.com` if you are +using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). -For the "Feed Address" field in the FeedBurner interface, you may choose -whatever suffix you prefer. In your Pelican settings, assign this suffix to -the `FEED_MAIN_URL` setting. So if your FeedBurner feed address is set to -`http://feeds.feedburner.com/myblogfeed`, in your Pelican settings you would -set: `FEED_MAIN_URL = "myblogfeed"`. Then set the `FEED_DOMAIN` setting to -`http://feeds.feedburner.com`, or `http://feeds.example.com` if you are using -a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). +There are two fields to configure in the `FeedBurner +`_ interface: "Original Feed" and "Feed +Address". In this example, the "Original Feed" would be +`http://www.example.com/thymefeeds/main.xml` and the "Feed Address" suffix +would be `thymefeeds/main.xml`. Pagination ========== diff --git a/pelican/settings.py b/pelican/settings.py index 9dea1e94..c0e30815 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -22,7 +22,6 @@ _DEFAULT_CONFIG = {'PATH': '.', 'STATIC_PATHS': ['images', ], 'THEME_STATIC_PATHS': ['static', ], 'FEED': 'feeds/all.atom.xml', - 'FEED_MAIN_URL': 'feeds/all.atom.xml', 'CATEGORY_FEED': 'feeds/%s.atom.xml', 'TRANSLATION_FEED': 'feeds/all-%s.atom.xml', 'FEED_MAX_ITEMS': '', diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 0fd388cf..f0f745e4 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -4,7 +4,7 @@ {% block title %}{{ SITENAME }}{%endblock%} - + {% if FEED_RSS %} {% endif %} @@ -56,7 +56,7 @@