Pug原名不叫Pug,原来是大名鼎鼎的jade,后来由于商标的原因,改为Pug,哈巴狗。以下是官方解释:
it has been revealed to us that "Jade" is a registered trademark, and as a result a rename is needed. After some discussion among the maintainers, "Pug" has been chosen as the new name for this project.
其实只是换个名字,语法都与jade一样。
1. Pug安装编译的二三事
开始安装之后
npm install -g pug
运行一下代码
pug index.pug
结果显示:
bash: pug: command not found
找了网上很多内容和教程,大部分都是关于jade的,去Github看了一下官方的讨论区,才知道
You need to install pug-cli. The CLI was separated from the core library as part of this release.
所以,成功解决问题
npm install -g pug-cli
二. 代码编辑器优化
sublime,可以在package control->install package中安装pug
webStrom,如果出现Invalid indentation,you can use tabs or spaces but not both错误,可以参考这篇文章[Jade报错: