danielfrg / pelican-jupyter

Pelican plugin for blogging with Jupyter/IPython Notebooks
Apache License 2.0
423 stars 105 forks source link

add "additional_tags" and "status" metatags in the metadata ipynb file #69

Closed Bamieh closed 6 years ago

Bamieh commented 7 years ago

having the metadata inside the ipynb file restricts the user to only a handful of metatags:

"title", "date", "category", "tags", "slug", "author"

This pull request adds an additional meta-tag "additional_tags" list inside the metadata object in order to expand the above list. additional keys can be accessed directly inside the pelican themes.

additionally, to fix #59 (the status: 'draft' issue when using ipynb metadata dict) i added "status" to the keys to check against in the metadata aswell.

Example

# inside the .ipynb file
{
   "metadata": {
      "additional_tags": ["Modified"],
      "Modified": "2017-04-30 08:58",
      "status": "draft"
}

usage inside a pelican theme:

<!-- articles.html -->
{% if article.modified %}
Last modified: {{ article.modified }}
{% endif %}
danielfrg commented 6 years ago

Thanks for the PR!

Now that there is more options to pass the metadata i think i am going to deprecate the option to modify the metadata in the ipynb file.