New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[static_comments] Support more metadata formats via metadata extractors #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
found_in_priority = False | ||
for extractor in self.site.metadata_extractors_by['priority'].get(priority, []): | ||
# We need to do a first check ourselves since metadata_extractors.check_conditions | ||
# expects a post object (to check the compiler, if MetaCondition.compiler is used). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be fixed upstream (in check_conditions) — care to make a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in getnikola/nikola#2878
"""Add static comments to posts.""" | ||
|
||
# Used to parse comment headers | ||
_header_regex = re.compile('^\.\. (.*?): (.*)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I forgot to remove that.
Thanks for reviewing! |
Fixes #232
It uses the metadata extractors introduced in getnikola/nikola#2861, which will be available in Nikola v8.