Skip to content

Commit

Permalink
Pass site when writing metadata in importers
Browse files Browse the repository at this point in the history
Note this is a minor API change (removes @staticmethod) that needs to be
reflected in some importers.

cc @felixfontein

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 8, 2017
1 parent f8d1814 commit d482f68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nikola/plugins/basic_import.py
Expand Up @@ -156,8 +156,7 @@ def write_post(cls, filename, content, headers, compiler, rewrite_html=True):
onefile=True,
**headers)

@staticmethod
def write_metadata(filename, title, slug, post_date, description, tags, **kwargs):
def write_metadata(self, filename, title, slug, post_date, description, tags, **kwargs):
"""Write metadata to meta file."""
if not description:
description = ""
Expand All @@ -166,7 +165,7 @@ def write_metadata(filename, title, slug, post_date, description, tags, **kwargs
with io.open(filename, "w+", encoding="utf8") as fd:
data = {'title': title, 'slug': slug, 'date': post_date, 'tags': ','.join(tags), 'description': description}
data.update(kwargs)
fd.write(utils.write_metadata(data, metadata_format='nikola', comment_wrap=False))
fd.write(utils.write_metadata(data, site=self.site, comment_wrap=False))

@staticmethod
def write_urlmap_csv(output_file, url_map):
Expand Down

0 comments on commit d482f68

Please sign in to comment.