一个小型静态网站生成器
legoman的Python项目详细描述
乐高
一个60行的微型静态网页生成器。
支持目录、图片标题、乳胶、代码突出显示和表格。
用法
pip install legoman # in an empty directory legoman init make html # run devserver (requires inotify-tools) make devserver
工作原理
.md
文件是使用在其frontmatter中指定的模板呈现的.j2
文件用jinja2呈现。它们可以循环.md
文件并访问它们的元数据- 所有其他文件都符号链接到
output/
例如,演示content/
:
content
├── codehilite.css
├── index.j2
├── projects
│ ├── bar_proj
│ │ └── index.md
│ └── foo_proj
│ ├── cheetos_small.png
│ └── index.md
└── styles.css
产生这个output/
output
├── codehilite.css
├── index.html
├── projects
│ ├── bar_proj
│ │ └── index.html
│ └── foo_proj
│ ├── cheetos_small.png
│ └── index.html
└── styles.css
另请参见
- Hugo-类似的想法,但是用go编写并使用go的模板引擎