1
0
Fork 0
forked from github/pelican
This commit is contained in:
Alexis Metaireau 2010-12-22 19:07:30 +00:00
commit 7873370583
3 changed files with 20 additions and 12 deletions

View file

@ -1,5 +1,6 @@
from operator import attrgetter
from itertools import chain
from functools import partial
from datetime import datetime
from collections import defaultdict
import os
@ -114,7 +115,7 @@ class ArticlesGenerator(Generator):
self.settings['TAG_FEED_RSS'] % tag, feed_type='rss')
translations_feeds = defaultdict(list)
for article in self.translations:
for article in chain(self.articles, self.translations):
translations_feeds[article.lang].append(article)
for lang, items in translations_feeds.items():
@ -128,7 +129,10 @@ class ArticlesGenerator(Generator):
TODO: change the name"""
templates = self.get_templates()
write = writer.write_file
write = partial(
writer.write_file,
relative_urls = self.settings.get('RELATIVE_URLS')
)
for template in _DIRECT_TEMPLATES:
write('%s.html' % template, templates[template], self.context,
blog=True)
@ -223,7 +227,8 @@ class PagesGenerator(Generator):
templates = self.get_templates()
for page in chain(self.translations, self.pages):
writer.write_file('pages/%s' % page.save_as, templates['page'],
self.context, page=page)
self.context, page=page,
relative_urls = self.settings.get('RELATIVE_URLS'))
class StaticGenerator(Generator):