Commits

Steven Kryskalla committed 04266c6

add a variable for excluding a post from the atom feed

this may be useful if you are migrating old blog posts to blohg and do not want
an old article to reappear as new in the feed

  • Participants
  • Parent commits bb6ae53

Comments (0)

Files changed (3)

blohg/hgapi/models.py

 
 from blohg.rst import parser
 
-re_metadata = re.compile(r'\.\. +([a-z]*): (.*)')
+re_metadata = re.compile(r'\.\. +(\w*): (.*)')
 re_read_more = re.compile(r'\.\. +read_more')
 re_author = re.compile(r'^(?P<name>[^<]*[^ ])( ?<(?P<email>[^<]*)>)?$')
 
                     author=current_app.config['AUTHOR'],
                     generator=('blohg', None, None))
     for post in posts[:int(current_app.config['POSTS_PER_PAGE'])]:
+        if post.dont_show_in_feed:
+            continue
         feed.add(FeedEntry(title=post.title, content=post.full_html,
                            summary=post.abstract_html,
                            id=url_for('views.content', slug=post.slug),
 
 This is useful if you want to migrate content from another blog.
 
+Preventing a post from showing up in the atom feed
+--------------------------------------------------
+
+Another variable that might be useful when migrating content from an old blog
+is ``dont_show_in_feed``. When this variable is set, it will prevent the post
+from showing up in the atom feed (so subscribers will not have an old article
+reappear in their reader as new).
+
+.. code-block:: rest
+
+   .. dont_show_in_feed: 1
+
 
 Overriding the post/page author
 -------------------------------