-
-
Notifications
You must be signed in to change notification settings - Fork 316
Home
reco_luan edited this page Jan 6, 2019
·
19 revisions
- This is a vuepress theme aimed at adding the categories, TAB walls, pagination, comments and other features required for blogging;
- The theme itself is minimalist and is modified based on the default theme of the vuepress.
- You can click vuepress-theme-reco to see it.
-
Install
npm install vuepress-theme-reco -dev--save # or yarn add vuepress-theme-reco
-
Use
// 修改 /docs/.vuepress/config.js module.exports = { theme: 'reco' }
If want to add a front-end
and back-end
classification, need to undertake the following steps:
-
Add a category drop button to the top navigation
// change /docs/.vuepress/config.js module.exports = { theme: 'reco', themeConfig: { nav: [ { text: 'categories', items: [ { text: 'frontEnd', link: '/categories/frontEnd' }, { text: 'backEnd', link: '/categories/backEnd' } ] } ] } }
-
Add the files needed for classification
/docs/categories/frontEnd.md
--- title: frontEnd isCategories: true sidebar: false --- ## frontEnd
/docs/categories/backEnd.md
--- title: backEnd isCategories: true sidebar: false --- ## backEnd
Why do you set sidebar false? Because you enable classification, that's a little bit of a conflict with the custom sidebar feature, so you globally turn on the auto sidebar feature, and then close it where you don't need a side marker
-
Add categories when writing articles
--- title: 【vue】跨域解决方案之proxyTable date: 2017-12-28 23:39:45 categories: frontEnd ---
-
Add a button to the top navigation
// change /docs/.vuepress/config.js module.exports = { theme: 'reco', themeConfig: { nav: [ { text: 'Tags', link: '/tags/' } ] } }
-
Add the required files
/docs/tags/README.md
--- isTags: true sidebar: false --- ## tag cloud
-
Add tags when writing articles
--- title: 【vue】跨域解决方案之proxyTable date: 2017-12-28 23:39:45 tags: - vue - webpack ---
Theme with a built-in valine comments, if you want to open this function, only configure your config.js
// change /docs/.vuepress/config.js
module.exports = {
theme: 'reco',
themeConfig: {
// valine
valineConfig: {
appId: '...',// your appId
appKey: '...', // your appKey
}
}
}
- On the mobile side, the search box will enlarge when it gets the focus, and it can scroll left and right after losing the focus, which can be optimized by setting the meta.
module.exports = {
head: [
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }]
]
}
- If you don't like the particle effect, you can turn it off. If you like it, you can also set the count and color of particles.
module.exports = {
title: "午后南杂",
theme: 'reco',
themeConfig: {
// particles
showParticles: true,
// particlesConfig
particlesConfig: {
color: '136, 136, 136', // color of line
count: 66, // number of particle
},
}
}
- If you want to click the tags in the list, you can set themeConfig's value of tagClick true
module.exports = {
title: "午后南杂",
theme: 'reco',
themeConfig: {
// whether you can click the tags in the list
tagClick: true,
}
}
- If your heroImage has your website title, maybe you need to set the value of
isShowTitleInHome
false
to make title not show
# this is your homepage
---
home: true
heroImage: /hero.png
isShowTitleInHome: false
---
- If you want change heroImage's style, you can set the value of
heroImageStyle
to achieve the effec you want
# this is your homepage
---
home: true
heroImage: /hero.png
heroImageStyle: {
maxHeight: '200px',
display: block,
margin: '6rem auto 1.5rem',
borderRadius: '50%',
boxShadow: '0 5px 18px rgba(0,0,0,0.2)'
}
---