dist编译好的 CSS 与 JS 存放的位置src没有编译的源文件存放位置static一些不需要编译的资源文件include模板中嵌入的片段,例如 header 与 footercdnCDN 配置i18n主题语言文件index.html首页(列表页)post.html文章页package.json标准的 NPM 包信息文件package-lock.json同上metadata.jsonSilverBlog 主题元数据
{
"name": "tcdw2018",
"description": "tcdw 2018 style for SilverBlog!",
"author": "tcdw <[email protected]>",
"bug": "https://github.com/silverblog-theme/tcdw2018/issues",
"license": "MIT",
"homepage": "https://github.com/silverblog-theme/tcdw2018",
"requireCompile": true,
"download": [
{
"url": "https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css",
"path": "font-awesome.css/css",
"filename": "font-awesome.min.css"
}
]
}如果 requireCompile 设为 true,且目标系统存在 Node.js 环境,则额外执行以下步骤:
- 自动执行
npm install - 自动执行
npm run build - 把
dist目录下的所有文件拷贝到static目录下
.gitignore 中需要额外填写以下内容:
# 整个 dist 目录
dist
# static 中已知会被拷贝过来的编译结果文件
static/bundle.css
static/bundle.js