def calc_tagcloud(self): tagcloud = merge(self.calc_tag_posts()) for k, v in tagcloud.items(): tag = NameSpace( name=k, count=len(v), size=100 + log(len(v) or 1) * 20, ) yield tag
def calc_tagcloud(self): tagcloud = merge(self.calc_tag_posts()) for k, v in tagcloud.iteritems(): tag = NameSpace( name=k, count=len(v), size=100 + log(len(v) or 1) * 20, ) yield tag
def run(self): _tpl = namespace.site.get('year_archive_template', None) for year, posts in merge(self.calc_year_posts()).iteritems(): posts = sort_posts(posts) year = str(year) dest = os.path.join(year, 'index.html') params = {'title': year} if _tpl: params.update({'tpl': _tpl}) self.write_pager(posts, dest, **params)
def run(self): self.write_tagcloud() tagcloud = merge(self.calc_tag_posts()) _tpl = namespace.site.get('tag_archive_template', None) for tag, posts in tagcloud.items(): posts = sort_posts(posts) dest = os.path.join('tag', tag, 'index.html') params = {'title': tag} if _tpl: params.update({'tpl': _tpl}) self.write_pager(posts, dest, **params)
def run(self): key = namespace.site.get('category', 'category') _archive_tpl = namespace.site.get('category_archive_template', None) _feed_tpl = namespace.site.get('category_feed_template', None) for cat, posts in merge(self.calc_category_posts()).iteritems(): posts = sort_posts(posts) dest = os.path.join(key, cat, 'index.html') params = {'title': cat} if _archive_tpl: params.update({'tpl': _archive_tpl}) self.write_pager(posts, dest, **params) dest = os.path.join(key, cat, 'feed.xml') params = {'title': cat, 'folder':''} if _feed_tpl: params.update({'tpl': _feed_tpl}) self.write_feed(posts, dest, **params)
def run(self): _archive_tpl = namespace.site.get('folder_archive_template', None) _feed_tpl = namespace.site.get('folder_feed_template', None) for folder, posts in merge(self.calc_folder_posts()).iteritems(): posts = sort_posts(posts) dest = os.path.join(folder, 'index.html') params = {'title': folder, 'folder': folder} if _archive_tpl: params.update({'tpl': _archive_tpl}) self.write_pager(posts, dest, **params) dest = os.path.join(folder, 'feed.xml') params = {'title': folder, 'folder': folder} if _feed_tpl: params.update({'tpl': _feed_tpl}) self.write_feed(posts, dest, **params)
def run(self): key = namespace.site.get('category', 'category') _archive_tpl = namespace.site.get('category_archive_template', None) _feed_tpl = namespace.site.get('category_feed_template', None) for cat, posts in merge(self.calc_category_posts()).iteritems(): posts = sort_posts(posts) dest = os.path.join(key, cat, 'index.html') params = {'title': cat} if _archive_tpl: params.update({'tpl': _archive_tpl}) self.write_pager(posts, dest, **params) dest = os.path.join(key, cat, 'feed.xml') params = {'title': cat, 'folder': ''} if _feed_tpl: params.update({'tpl': _feed_tpl}) self.write_feed(posts, dest, **params)