Skip to content

Commit bacebe2

Browse files
committed
doc: npm package consolidate
1 parent eb7ac1d commit bacebe2

File tree

7 files changed

+15
-4
lines changed

7 files changed

+15
-4
lines changed

.DS_Store

0 Bytes
Binary file not shown.
599 KB
Loading

docs/start/npm.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sidebarDepth: 0
1111
* [metalsmith](https://github.com/segmentio/metalsmith);An extremely simple, pluggable static site generator。
1212
* [chalk](https://github.com/chalk/chalk):Terminal string styling done right。
1313
* [download-git-repo](https://github.com/flipxfx/download-git-repo):Download and extract a git repository (GitHub, GitLab, Bitbucket) from node。
14-
* [consolidate](https://github.com/tj/consolidate.js)
14+
* [consolidate](https://github.com/tj/consolidate.js):Template engine consolidation library for node.js 。
1515

1616
下面逐个介绍:
1717

@@ -153,4 +153,15 @@ download(repository, destination, options, callback)
153153
* options:选项,clone。是以 http download 的形式还是 git clone 的形式下载。其中 git clone 的形式支持下载 private 仓库。
154154
* callback:下载完成地回调。
155155

156-
更多例子可查看 [详细文档](https://github.com/flipxfx/download-git-repo)
156+
更多例子可查看 [详细文档](https://github.com/flipxfx/download-git-repo)
157+
158+
# consolidate
159+
`consolidate` 是一个模版引擎整合库,它的作用是把一些著名的模板引擎适配成 `Express` 兼容的接口。在 `vue-cli``init` 命令中利用 `consolidate.handlebars.render` 是实现模版的渲染。在 `/example/metalsmith` 目录里有个 `demo`,就是通过 `metalsmith` 以及`consolidate.handlebars.render` 方法将一个 `package.json``handlebars` 的模板引擎来渲染,在项目里运行
160+
161+
``` bash
162+
npm run metalsmith
163+
```
164+
<img :src="$withBase('/assets/install-img03.gif')">
165+
166+
希望可以通过这个小 `demo` 比较好地理解 `metalsmith``handlebars``consolidate` 以及`inquirer`
167+

example/metalsmith/src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "metal-demo",
2+
"name": "metalsmith-demo",
33
"description": "A metalsmith-demo project"
44
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"docs": "vuepress dev docs",
1111
"docs:build": "vuepress build docs",
1212
"deploy": "sh deploy.sh",
13-
"metal": "node ./example/metalsmith/index.js",
13+
"metalsmith": "node ./example/metalsmith/index.js",
1414
"test": "echo \"Error: no test specified\" && exit 1"
1515
},
1616
"repository": {

static/assets/demo.gif

105 KB
Loading

static/assets/demo1.gif

69.9 KB
Loading

0 commit comments

Comments
 (0)