Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Pelican actually handle tags a bit differently.
Browse files Browse the repository at this point in the history
The previous version was working but not in all situations, and especially it
wasn't able to generate the tag feeds.
  • Loading branch information
almet committed Feb 23, 2016
1 parent f60ad04 commit 870ac43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions add_mozilla_tag.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from pelican import signals
from pelican.contents import Tag

def add_category(generator):
tag = Tag('mozilla', generator.settings)
for article in generator.articles:
if hasattr(article, 'tags'):
article.tags.append('mozilla')
else:
setattr(article, 'tags', ['mozilla'])
if not hasattr(article, 'tags'):
setattr(article, 'tags', [tag,])

def register():
signals.article_generator_finalized.connect(add_category)
signals.article_generator_pretaxonomy.connect(add_category)
1 change: 1 addition & 0 deletions publishconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
TAG_FEED_ATOM = "feeds/%s.atom.xml"

DELETE_OUTPUT_DIRECTORY = True

Expand Down

0 comments on commit 870ac43

Please sign in to comment.