~kungtotte/dtt

1031e21e0e1ad77a889d83b29f818be6894c3df1 — Thomas Landin 6 months ago 9c4de64
Document template variables

It might be a good idea if people knew what variables they could use for
their templates!
1 files changed, 29 insertions(+), 0 deletions(-)

M doc/dtt.1.scd
M doc/dtt.1.scd => doc/dtt.1.scd +29 -0
@@ 59,6 59,35 @@ your life easier.
- All pages are linked in the menu at the top.
- No posts are linked in the menu at the top.

## TEMPLATE VARIABLES

These are the (currently existing) template variables you can use in your
templates. The post ones only work inside posts.mustache, the rest work in
page.mustache as well as any named template file.

For partial templates it depends on where you include them (a page or a post)
what variables are available (the set of page vars or the set of post vars).

For pages:

- {{{content}}} - The rendered markdown from any given markdown file
- {{latest_post}} - The latest blog post
- {{blog_posts}} - A truncated list of blog posts (defaults to 5)
- {{blog_index}} - All of the blog posts
- {{id}} - Blog slug
- {{{post}}} - Blog content (note triple {{{, since this contains html)
- {{date}} - Blog date
- {{link}} - Blog permanent link
- {{links}} - Links to all the pages to be used in a menu.
- {{target}} - Link target
- {{title}} - Link title

For posts (post.mustache):

- {{slug}} - Title
- {{date}} - Date
- {{blog_link}} - Self-referential link to post

# SEE ALSO

*mustache*(5)