Skip to content
Permalink
Browse files

Pass site when writing metadata in importers

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 d482f68a2b6034ee22a3136cdf5d503df7d8fe51
Showing with 2 additions and 3 deletions.
  1. +2 −3 nikola/plugins/basic_import.py
@@ -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 = ""
@@ -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):

0 comments on commit d482f68

Please sign in to comment.
You can’t perform that action at this time.