CNode

最简单的静态网站生成器: Pagic

分享
Xxcatliu发布于9 年前最后回复9 年前3 回复6524 浏览0 收藏

GitHub: https://github.com/xcatliu/pagic


最近很多地方用到了静态网站,但是 Jekyll 和 Hexo 都太重了,我完全不需要它的主题和博客文章功能,所以做了一个静态网站生成器的轮子,取名为 Pagic ,分享给大家。

The easiest way to generate static html page from markdown

特性

  • 极简的使用方式:只需要 xxx.md_layout.js 即可
  • 其他静态资源文件直接复制到 public 文件夹
  • 支持 sub page 和 sub layout ,每个 Markdown 文件会一级一级往上查找,选择最近的 _layout.js 作为模板
  • 传入 relativeToRoot 到模板中,方便插入静态资源如 css
  • 支持 cli 和 node modules 引入
查看回复

回复 (3)

X
xcatliu#1·9 年前

v0.4.0

Breaking Changes

  • Use pagic build instead of pagic
  • require('pagic') will return the Pagic class

New Features

_config.yml

We can set the configuration in _config.yml, the default is:

src_dir: src
public_dir: public

pagic build

We can use pagic build to build static page, there are some options while using build command:

pagic build [options]


# -w, --watch  watch src dir change

# -s, --serve  serve public dir

# -p, --port   override default port

pagic init

We can use pagic init to create a new Pagic folder:

pagic init <dir>
Z
zsea#3·9 年前

收藏

参与回复
登录后即可参与回复。登录