pelican-md-metayaml/README.md

53 lines
1.7 KiB
Markdown
Raw Normal View History

2014-12-25 05:41:29 +00:00
pelican-md-metayaml
===================
2014-08-29 15:13:46 +00:00
This [Pelican](https://github.com/getpelican/pelican) plugin adds a reader for Markdown files with [YAML](https://en.wikipedia.org/wiki/YAML) metadata.
As the well-known static site generator [Jekyll](https://github.com/jekyll/jekyll) uses Markdown files with YAML metadata, this eases migration from Jekyll to Pelican.
Also, YAML metadata allows for easier specification of more complex metadata, such as nested lists or dictionaries.
2014-11-02 01:38:41 +00:00
Dependencies
------------
(to be installed via `pip`)
2014-11-02 01:43:45 +00:00
* [`Markdown`](https://pypi.python.org/pypi/Markdown)
* [`PyYAML`](https://pypi.python.org/pypi/PyYAML)
2014-11-02 01:38:41 +00:00
2014-08-29 15:13:46 +00:00
Installation
------------
2014-12-25 05:41:29 +00:00
Clone this repo (and it's submodules) to the `plugins` directory of your Pelican project (or whatever directory you specified for plugins in Pelican's `PLUGIN_PATHS` setting) and add `'md_metayaml'` to the list of plugins (Pelican setting `PLUGINS`) of your project.
To make sure the submodule is included use `git clone --recursive [repo] [path]`
Alternatively, you can clone normally, then run `git submodule update --init` to checkout the submodule
2014-08-29 15:13:46 +00:00
Usage
-----
All your Markdown files (ending in `.md`, `.markdown`, `.mkd` and `.mdown`) will now be interpreted as using YAML for their metadata.
2014-12-25 05:41:29 +00:00
2014-08-29 15:13:46 +00:00
The following example shows a very simple article (only one line of text at the bottom) but with quite complex metadata (everything between the `---`):
```
---
2014-12-25 05:41:29 +00:00
title: Some title
author: Some person
tags:
- tag 1
- tag 2
date: 2014-12-25 00:00
data:
- name: some name
options:
- opt 1
- opt 2
- opt 3
2014-08-29 15:13:46 +00:00
steps:
2014-12-25 05:41:29 +00:00
- Step 1
- Step 2
- Step 3
2014-08-29 15:13:46 +00:00
---
2014-12-25 05:41:29 +00:00
This is the only text in the article.
2014-08-29 15:13:46 +00:00
```