victorstanciu/Wikitten — pull request #15 by filp (2013-03-07 11:48:45+00:00)
Title: Implement #14 - Optional JSON page header

This PR implements #14, and allows a user to attach meta-data to specific content using a JSON Front Matter.

This feature is passive (pages do not required it to work properly), and can be actively disabled using the new configuration option `(bool) USE_PAGE_METADATA`.

Right now the use is somewhat limited, but the implications of such a feature for something like searching, or content relationships are huge.

The following is the documentation section for this feature (included in this PR):
---

### JSON Front Matter (meta data)

Wikitten content can also be tagged using a simple but powerful JSON Front Matter system, akin to [Jekyll's YAML Front Matter](https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter). Defining a custom title, tags, or other
relevant data for a specific page is just a matter of adding a special header at the start of your files, like so:

---
"title": "My Custom Page Title",
"tags": ["my", "custom", "tags"],
"author": "Bob"
---

# Hello, world!

This is my cool wiki page.

Wikitten will intelligently grab this data, and use it for things like meta keywords, the
page title, and maybe eventually search indexing. All the information provided in this
header is passed as-is to the views, so future components and plugins may also make use of it.

**Note:** The JSON header is expected to be a JSON hash, but to simplify things, Wikitten lets you leave out the starting an ending `{ }` brackets if you want. Everything else in the JSON syntax still applies:

- Strings (i.e: `title` must be written within double quotes: `"title"`)
- Values must be seperated with a comma character, even if its the only value in a line.