静态站点生成器
Nib的Python项目详细描述
nib是一个静态站点生成器,用python编写,旨在创建 简单的网站或博客。nib使用一个可插入的内容管道来区分 在css或javascript之类的“资源”和静态页面之类的“文档”之间 或博客文章。这两条管道是相似的,是并行执行的,并且 定义多个钩子,插件可以处理实体的子集,甚至 删除实体或在运行时生成新实体。
从默认向导和模板生成的示例站点位于 http://nib.noswap.com
[![生成状态](https://travis-ci.org/jreese/nib.png?branch=master)](https://travis-ci.org/jreese/nib)
要求
- python 2.7或3.2+
安装
要安装最新的官方版本:
$ pip3 install nib
或安装当前从源签出的版本:
$ pip install -r requirements.txt $ python3 setup.py install
开始
一旦安装了nib,就可以使用 内置向导:
$ mkdir somesite && cd somesite $ nib wizard …
向导完成后,您应该有一个站点配置文件 示例文档(一页和两篇博客文章)和一个最小的站点主题 包括资源(favicon、css和robots.txt)和模板:
$ ls config.nib documents/ resources/ templates/
$ ls documents about.md links/ posts/
$ ls resources favicon.ico main.less robots.txt
$ ls templates feed.xml list.html macros.html page.html post.html posts.html
建立网站:
$ nib … Done
生成的html和资源将位于站点/目录:
$ ls config.nib documents/ resources/ site/ templates/
$ ls site 2012/ about.html archive.html favicon.ico feed.xml index.html links/ main.css posts/ robots.txt tags/
为了测试生成的站点,nib可以运行一个简单的http服务器,也可以打开 首选Web浏览器中的本地服务器:
$ nib serve Serving site on port 8000… press Ctrl-C to terminate. ^C Done
或:
$ nib serve –port 9000 –browse Serving site on port 9000… press Ctrl-C to terminate. Opening http://localhost:9000 in web browser… ^C Done
许可证
NIB是根据麻省理工学院的许可证授权的。有关详细信息,请参见许可证文件。
学分
nib是由[约翰里斯](http://noswap.com)作为爱的劳动而开发的。 它建立在开源社区的许多优秀项目之上,例如:
- [jinja2](http://jinja.pocoo.org)
- [降价](http://pypi.python.org/pypi/Markdown/)
- [pyyaml](http://pyyaml.org)
- [sh](https://github.com/amoffat/sh)
NIB的设计灵感来源于 [oben sonne](http://obensonne.bitbucket.org/)和他的项目 [池](http://bitbucket.org/obensonne/poole)。