You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Foo bar
date: 2020-01-01 10:00:00
This is text
If the metadata delimiters are not found and the option is enabled, the plugin could do something like this:
meta, sep, content=text.partition("\n\n")
try:
metadata=yaml.load(meta, Loader=...)
exceptyaml.error.YAMLError:
content=textmetadata= {}
else:
# Prevent false-positives if the text does not begin with a metadata blockifisinstance(metadata, str):
metadata= {}
content=textself.md.Meta=metadatareturncontent
The text was updated successfully, but these errors were encountered:
I agree that this should generally be preferred. However, sometimes existing data is in the old format. Have you looked at the linked PR #21? It makes this behavior configurable (off by default).
Use case: I migrated @mixxxdj/website to Pelican from cactus and used your module to add support for extra metadata. But most of the old blog posts lack the YAML delimiters and changing them all would be really annoying.
This might work for very simple metadata, like:
If the metadata delimiters are not found and the option is enabled, the plugin could do something like this:
The text was updated successfully, but these errors were encountered: