Skip to content

Commit

Permalink
jsonfeed: depend on taxonomies and make dirs
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 22, 2017
1 parent e55b72b commit 83ac1fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v7/jsonfeed/jsonfeed.py
Expand Up @@ -181,7 +181,6 @@ def get_link(self, path_handler, classification, lang):
"""Get link for a page."""
return urljoin(self.site.config['BASE_URL'], self.site.link(path_handler, classification, lang).lstrip('/'))


def jsonfeed_html_link(self, site, context):
"""Generate HTML fragment with link to JSON feed."""
pagekind = context['pagekind']
Expand Down Expand Up @@ -244,7 +243,7 @@ def generate_feed_task(self, lang, title, link, description, timeline,
'name': str(output_name),
'targets': [output_name],
'file_dep': deps,
'task_dep': ['render_posts'],
'task_dep': ['render_posts', 'render_taxonomies'],
'actions': [(self.generate_feed, (lang, title, link, description,
timeline, feed_url, output_name,
primary_author))],
Expand Down Expand Up @@ -338,5 +337,7 @@ def generate_feed(self, lang, title, link, description, timeline,
"items": items
}

utils.makedirs(os.path.dirname(output_name))

with io.open(output_name, 'w', encoding='utf-8') as fh:
json.dump(feed, fh, ensure_ascii=False, indent=4)

0 comments on commit 83ac1fd

Please sign in to comment.