Skip to content

Commit d482f68

Browse files
committed
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>
1 parent f8d1814 commit d482f68

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

nikola/plugins/basic_import.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ def write_post(cls, filename, content, headers, compiler, rewrite_html=True):
156156
onefile=True,
157157
**headers)
158158

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

171170
@staticmethod
172171
def write_urlmap_csv(output_file, url_map):

0 commit comments

Comments
 (0)