gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 122 forks source link

Specify page metadata as YAML #21

Closed gma closed 12 years ago

gma commented 13 years ago

There's no reason why you shouldn't be able to add any meta data that you like to a page. This new meta data could have a structure to it (e.g. it could be a list of usernames, URLs, twitter accounts, etc.). Rather than re-inventing the wheel and writing a new parser, we'll allow people to specify meta data in YAML (the existing format is already a subset of YAML). Sadly the current metadata format isn't backwards compatible (the keys are, but typical values for article summaries aren't), so it should be implemented as a plugin.

Tasks

gryzzly commented 13 years ago

came here to ask if it'd be possible to use custom metadata :-) is there a way available today?

gma commented 13 years ago

Do you see that first bullet point? That got implemented on master by Wynn from thechangelog, and is in the latest gem. You can read it by calling page.metadata('string'). You don't need to worry about getting the case right; it should just work if you query it in lower case.

gryzzly commented 13 years ago

thanks for the fast reply – it works awesomely.

gma commented 12 years ago

See http://github.com/gma/nesta-plugin-yaml-metadata.