Skip to content

Commit

Permalink
feat: add sitemap plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Jan 28, 2024
1 parent adf64ef commit 672da45
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/text/.obsidian
node_modules
*.bkp
*.log

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ paid for this book.**

## 编译

本书采用 [gitbook](https://www.gitbook.com/) 进行编译,如果你想在本地编译,需要安装 gitbook-cli
本书采用 [vuepress](https://vuepress.vuejs.org/) 进行编译,如果你想在本地编译,可以执行如下命令

```
npm install gitbook-cli -g
npm run build
```

然后在项目目录中运行`gitbook serve`即可编译生成html,并且创建一个本地预览网站,其他详细的编译参数可以参照[官方文档](https://toolchain.gitbook.com/setup.html)

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"markdown-it-disable-url-encode": "^1.0.1",
"vuepress": "^1.9.10",
"vuepress-plugin-autometa": "^0.1.13",
"vuepress-plugin-go-top": "^1.0.4",
"vuepress-plugin-sitemap": "^2.3.1"
}
}
10 changes: 5 additions & 5 deletions text/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ module.exports = {
},
canonical_base: baseUrl,
},
// 'sitemap': {
// hostname: baseUrl,
// // 排除无实际内容的页面
// exclude: ["/404.html"]
// }
'sitemap': {
hostname: baseUrl,
// 排除无实际内容的页面
exclude: ["/404.html"]
}
}

}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8505,6 +8505,11 @@ vuepress-plugin-container@^2.0.2:
"@vuepress/shared-utils" "^1.2.0"
markdown-it-container "^2.0.0"

vuepress-plugin-go-top@^1.0.4:
version "1.0.4"
resolved "https://registry.npmmirror.com/vuepress-plugin-go-top/-/vuepress-plugin-go-top-1.0.4.tgz#b2c359d85280e8737c65a43fde6e6d42953878af"
integrity sha512-VxYrZmvC9agXVOEzy1G7mJj23p17O7CVmcXhlaFtQ+J827OcIqNC1X646/gOI8Hfn8or17+J+8/Bg0ZSRyizEA==

vuepress-plugin-sitemap@^2.3.1:
version "2.3.1"
resolved "https://registry.npmmirror.com/vuepress-plugin-sitemap/-/vuepress-plugin-sitemap-2.3.1.tgz#51298aca77a5de96396fdbd1103e1637dd61ae6a"
Expand Down

0 comments on commit 672da45

Please sign in to comment.