- Template
- Markdown
- Draft
- Video/Audio (ffmpeg)
- Tag
- RSS
-
Give it a title:
./baker post I love pizza so much!
This command will create a markdown file that has the slugi-love-pizza-so-much
in thepost
directory. If the$EDITOR
environment variable is set, it will open up the post markdown file with the editor. -
Change
draft
fromtrue
tofalse
to publish the post. -
Bake all posts:
./baker bake
The new template engine is much faster (and smaller) than the previous version. It now uses bash's scope as its context.
Variable identifier should only use [A-Za-z_]
. Notice that any number is not allowed in a variable name.
{{ var }}
{{ content }} # embed child layout output
Notice that spaces are not allowed between !
and var
.
@if !var
...
@end
@each
iterates an array. This is why a number is not allowed in a variable name.
For example,
posts = [
{
"title": "first",
"content": "example1",
},
{
"title": "second",
"content": "example2",
},
]
is encoded as:
posts_0_title=first
posts_0_content=example1
posts_1_title=second
posts_1_content=example2
@each posts
{{ title }} - {{ content }}
@end
@include
includes a partial from $LAYOUT_DIR/$filename.md
. Notice that .md
is already added.
@include filename
@cmd
gets stdout from embedded bash script.
@cmd
for i in {1..10}; do
echo "$i"
done
@end
It currently uses the implementation from Daring Fireball.
This software is made by taylorchu, and is released under GPL2.