From e626f771c433c1315f7a7599d51855ec58f6b4f7 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Mon, 16 Jul 2012 13:47:39 -0700 Subject: [PATCH] Add Themes and FAQ documentation on the new FEED_ATOM Added all the FEED_ATOM variables to _handle_deprecation Put FEED_ATOM around `if` in notmyidea --- docs/faq.rst | 33 ++++++++++++++++++++ docs/themes.rst | 16 ++++++++++ pelican/__init__.py | 21 +++++++++++++ pelican/themes/notmyidea/templates/base.html | 2 ++ 4 files changed, 72 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index 71acb78e..c6bf209b 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -79,3 +79,36 @@ warning. If configured properly no other make commands should have this message. Feeds still are generated when this error comes up, but may not validate. + +My feeds are broken since I upgraded to 3.0 +=========================================== + +Starting in 3.0 we changed the more confusing FEED options to say FEED_ATOM +like the RRS feed options. Here is an exact list of the changes:: + + FEED -> FEED_ATOM + TAG_FEED -> TAG_FEED_ATOM + CATEGORY_FEED -> CATEGORY_FEED_ATOM + +Older 2.x themes that referenced these may not link properly. Please update +your themes for 3 on. Here is some example code you can use for the header + +.. code-block:: html+jinja + {% if FEED_ATOM %} + + {% endif %} + {% if FEED_RSS %} + + {% endif %} + {% if CATEGORY_FEED_ATOM %} + + {% endif %} + {% if CATEGORY_FEED_RSS %} + + {% endif %} + {% if TAG_FEED_ATOM %} + + {% endif %} + {% if TAG_FEED_RSS %} + + {% endif %} diff --git a/docs/themes.rst b/docs/themes.rst index 8e432a95..bd5d9525 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -189,6 +189,22 @@ dates_page The current page of articles, ordered by date, page_name 'tag/`tag_name`' -- useful for pagination links =================== =================================================== +Feeds +===== + +The feed variables changed in 3.0. Each variable now explicitly lists ATOM or +RSS in the name. ATOM is still the default. Old themes will need to be updated. +Here is a complete list of the feed variables:: + + FEED_ATOM + FEED_RSS + CATEGORY_FEED_ATOM + CATEGORY_FEED_RSS + TAG_FEED_ATOM + TAG_FEED_RSS + TRANSLATION_FEED + + Inheritance =========== diff --git a/pelican/__init__.py b/pelican/__init__.py index 77db7498..5696b0dd 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -114,6 +114,27 @@ class Pelican(object): self.settings[setting]) logger.warning("%s = '%s'" % (setting, self.settings[setting])) + if self.settings.get('FEED', False): + logger.warning('Found depreciated `FEED` in settings. Modify FEED' + ' to FEED_ATOM in your settings and theme for the same behavior.' + ' Temporarily setting FEED_ATOM for backwards compatibility.') + self.settings['FEED_ATOM'] = self.settings['FEED'] + + if self.settings.get('TAG_FEED', False): + logger.warning('Found depreciated `TAG_FEED` in settings. Modify ' + ' TAG_FEED to TAG_FEED_ATOM in your settings and theme for the ' + 'same behavior. Temporarily setting TAG_FEED_ATOM for backwards ' + 'compatibility.') + self.settings['TAG_FEED_ATOM'] = self.settings['TAG_FEED'] + + if self.settings.get('CATEGORY_FEED', False): + logger.warning('Found depreciated `CATEGORY_FEED` in settings. ' + 'Modify CATEGORY_FEED to CATEGORY_FEED_ATOM in your settings and ' + 'theme for the same behavior. Temporarily setting ' + 'CATEGORY_FEED_ATOM for backwards compatibility.') + self.settings['CATEGORY_FEED_ATOM'] = self.settings['CATEGORY_FEED'] + + def run(self): """Run the generators and return""" diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 0994aac9..9d35caa0 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -4,7 +4,9 @@ {% block title %}{{ SITENAME }}{%endblock%} + {% if FEED_ATOM %} + {% endif %} {% if FEED_RSS %} {% endif %}