baker
所属分类:前端开发
开发工具:Perl
文件大小:0KB
下载次数:0
上传日期:2016-10-09 18:30:25
上 传 者:
sh-1993
说明: 具有真实模板引擎的bash静态站点生成器
(The bash static site generator with real template engine)
文件列表:
LICENSE.txt (18092, 2015-07-12)
Markdown.pl (35622, 2015-07-12)
baker (6466, 2015-07-12)
layout/ (0, 2015-07-12)
layout/author.md (559, 2015-07-12)
layout/bootstrap.md (362, 2015-07-12)
layout/disqus.md (670, 2015-07-12)
layout/fontawesome.md (116, 2015-07-12)
layout/head.md (342, 2015-07-12)
layout/index.md (846, 2015-07-12)
layout/post.md (785, 2015-07-12)
post/ (0, 2015-07-12)
post/2015-06-19-hello-world.md (378, 2015-07-12)
public/ (0, 2015-07-12)
public/css/ (0, 2015-07-12)
public/css/base.css (1086, 2015-07-12)
public/favicon.png (21855, 2015-07-12)
public/image/ (0, 2015-07-12)
public/image/baker.png (12556, 2015-07-12)
# baker, the real static blog generator in bash
![baker](http://i.imgur.com/Tngl5Vv.png)
- [x] Template
- [x] Markdown
- [x] Draft
- [ ] Video/Audio (ffmpeg)
- [ ] Tag
- [ ] RSS
## Start your first post
1. Give it a title: `./baker post I love pizza so much!` This command will create a markdown file that has the slug `i-love-pizza-so-much` in the `post` directory. If the `$EDITOR` environment variable is set, it will open up the post markdown file with the editor.
2. Change `draft` from `true` to `false` to publish the post.
3. Bake all posts: `./baker bake`
## Template redesigned
The new template engine is much faster (and smaller) than the previous version. It now uses bash's scope as its context.
### variable
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
```
### if
Notice that spaces are not allowed between `!` and `var`.
```
@if !var
...
@end
```
### each
`@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
`@include` includes a partial from `$LAYOUT_DIR/$filename.md`. Notice that `.md` is already added.
```
@include filename
```
### cmd
`@cmd` gets stdout from embedded bash script.
```
@cmd
for i in {1..10}; do
echo "$i"
done
@end
```
## Markdown
It currently uses the implementation from [Daring Fireball](http://daringfireball.net/projects/markdown/).
## License
This software is made by taylorchu, and is released under GPL2.
近期下载者:
相关文件:
收藏者: