more on templates

This commit is contained in:
nuex 2011-09-22 11:42:14 -04:00
parent 1bb48a5b2b
commit 8c0f20fe97

View File

@ -43,13 +43,15 @@ A typical Zodiac project will look something like this:
Each markdown page can have its own meta file. The only requirement is that the meta file is in the same directory as the page, has the same name as the page and has the `.meta` file extension. Each markdown page can have its own meta file. The only requirement is that the meta file is in the same directory as the page, has the same name as the page and has the `.meta` file extension.
The optional `global.meta` file contains data that is available to all of your site's pages, like a site_title. The optional `global.meta` file contains data that is available to all of your site's pages, like a site title.
Page metadata will always override global metadata of the same key. Page metadata will always override global metadata of the same key.
### Layouts ### Templates
A `main.layout` file should look something like this: Templates come in two forms: markdown files with an `.md` extension or layout files with a `.layout` extension. Metadata can be bound to templates by using the `{{key}}` notation in your markdown and layout files. A `main.layout` file could look something like this:
`{{{yield}}}` is a special tag that renders the markdown page content within the layout. `{{{yield}}}` can only be used in the `main.layout` file.
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -93,6 +95,12 @@ The `helpers.awk` file is an awk script that can make custom data available to y
Just be sure to set the data array in the load_helpers() function at the top of the script to make your custom data available to the template. Just be sure to set the data array in the load_helpers() function at the top of the script to make your custom data available to the template.
### License ## FUTURE
- multiple layout support
- mustache support
- partials/snippets
## LICENSE
MIT MIT