VuePress 配置记录
mkdir vuepress-starter && cd vuepress-starter
npm init
npm install -D vuepress
vim package.json
{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"docs:deploy": "bash deploy.sh"
}
}
mkdir -p docs/public/assets
vim docs/README.md
vim docs/public/config.js
vim deploy.sh
npm run docs:dev
README.md
---
home: true
heroImage: /assets/avatar.jpg
heroText: NFE-W`S BLOG
tagline: Just a study note for myself
actionText: Go →
actionLink: /sui-bi/
features:
- title: 随笔
details: 随便记记。
- title: Todo
details: todo
- title: Todo
details: todo
footer: MIT Licensed | Copyright © 2022-present NFE-W
---
config.js
module.exports = {
title: 'NFE-W`S BLOG',
description: 'Just a study note for myself',
base: '/',
markdown: {
lineNumbers: true
},
plugins: ['permalink-pinyin', ['autobar', {'pinyinNav': true}], 'rpurl'],
themeConfig: {
repo: 'https://github.com/nfe-w',
repoLabel: 'GitHub',
nav: [
{ text: 'Home', link: '/' },
{ text: 'Repo', link: 'https://github.com/nfe-w/my-note' },
],
}
}
deploy.sh
#!/bin/sh
set -e
npm run docs:build
cd docs/.vuepress/dist
echo 'note.nfe-w.top' > CNAME
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:nfe-w/nfe-w.github.io.git master
cd -
npm install -D boboidream/vuepress-bar
vim docs/public/config.js
module.exports = {
plugins: ['autobar']
}
npm install -D vuepress-plugin-permalink-pinyin
vim docs/public/config.js
module.exports = {
plugins: ['permalink-pinyin']
}
npm install -D boboidream/vuepress-plugin-rpurl
vim docs/public/config.js
module.exports = {
plugins: ['rpurl']
}