3 ~
's is the minimum for designating and separating a YAML block, but they can be extended longer -- all that matters
is that the tildes (~
) are on their own line.
And anything beyond that gets interpreted as Markdown!
[Markdown][markdown]!
You can even use template tags in here, for any variables you set in in the top YAML block, or in your site.yaml
file:
This post's title is: "About SiteGen"
This file was last modified on 3/30/2015
Note that variables beginning with an underscore designate implicit metadata added by SiteGen. Some vars that are always available by default:
`title`: post title, automatically set to name of markdown file if left blank
`_site`: site.yaml values
`_date`: post 'last modified' date
`_content`: post content (only accessible from templates, not markdown)
And as you can see, you can also use mustache logic to iterate through yaml maps and lists: Links are rendered incorrectly. Bug: https://github.com/dpeek/dart-markdown/issues/35
- [Dart](https://dartlang.org)
- [Pub](https://pub.dartlang.org)
- [Google](http://google.com)
- [Github](http://github.com)
* [SiteGen][sitegen]
* [Markdown][markdown]
* [Mustache][mustache]
* [YAML][yaml]
- foo
- bar
- baz
Note how you need to use a .
to access a list item, but can access map/dict keys directly.
You can of course disable these markdown templating features by setting markdown_templating: true
in your site.yaml file.
Same ideas apply when writing your actual HTML templates. See mustache's docs for more templating info.