Browse Source

fix tagger docs, if extension is blank/None, don't add an extension

main
John-Mark Gurney 3 years ago
parent
commit
0678bc098e
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      hyde/ext/plugins/meta.py

+ 6
- 2
hyde/ext/plugins/meta.py View File

@@ -295,7 +295,7 @@ class TaggerPlugin(Plugin):
template: tagged_posts.j2 template: tagged_posts.j2
source: blog source: blog
target: blog/tags target: blog/tags
archive_extension: html
extension: html
""" """


def __init__(self, site): def __init__(self, site):
@@ -423,7 +423,11 @@ extends: false
"meta": meta_text "meta": meta_text
} }
text = archive_text % tag_data text = archive_text % tag_data
archive_file = File(target.child("%s.%s" % (tagname, extension)))
if extension:
fname = "%s.%s" % (tagname, extension)
else:
fname = tagname
archive_file = File(target.child(fname))
archive_file.delete() archive_file.delete()
archive_file.write(text.strip()) archive_file.write(text.strip())
self.site.content.add_resource(archive_file) self.site.content.add_resource(archive_file)


Loading…
Cancel
Save