手把手带你用 VuePress + Github Pages 搭建博客

VuePress教程:构建个性化博客与自定义主题设置

ea88c96f6ca28dc0c54ff58dd69d2a88.png

3. 添加导航栏


我们现在在页首的右上角添加导航栏,修改 config.js:

module.exports = {

title: ‘…’,

description: ‘…’,

themeConfig: {

nav: [

{ text: ‘首页’, link: ‘/’ },

{

text: ‘冴羽的 JavaScript 博客’,

items: [

{ text: ‘Github’, link: ‘https://github.com/mqyqingfeng’ },

{ text: ‘掘金’, link: ‘https://juejin.cn/user/712139234359182/posts’ }

]

}

]

}

}

效果如下:

e45570d5923f7ee58c55f5afd06b6606.png

更多的配置参考 VuePress 导航栏。

4. 添加侧边栏


现在我们添加一些 md 文档,目前文档的目录如下:

.

├─ docs

│  ├─ README.md

│  └─ .vuepress

│     └─ config.js

|  └─ handbook

|     └─ ConditionalTypes.md

|     └─ Generics.md

└─ package.json

我们在 config.js 配置如下:

module.exports = {

themeConfig: {

nav: […],

sidebar: [

{

title: ‘欢迎学习’,

path: ‘/’,

collapsable: false, // 不折叠

children: [

{ title: “学前必读”, path: “/” }

]

},

{

title: “基础学习”,

path: ‘/handbook/ConditionalTypes’,

collapsable: false, // 不折叠

children: [

{ title: “条件类型”, path: “/handbook/ConditionalTypes” },

{ title: “泛型”, path: “/handbook/Generics” }

],

}

]<

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值