VuePress博客美化之reco主题
vuepress博客主题—vuepress-theme-reco是一款简洁而优雅的 vuepress博客&文档主题。它既可以成为简洁而又不失美观的主题,又可以书写你的项目文档,看起来更有逼格。




主题官方介绍:
这是一个vuepress主题,旨在添加博客所需的分类、TAB墙、分页、评论等能;
主题追求极简,根据 vuepress 的默认主题修改而成,官方的主题配置仍然适用;
效果:午后南杂
文档:vuepress-theme-reco-doc
如果没有接触过VuePress,这里有一篇指北:
如何安装主题
npx安装
npx @vuepress-reco/theme-cli init
npm安装
//下载@vuepress-reco/theme-cli(这是主题作者给我们提供的脚手架,可以简化我们的配置)
npm npm install @vuepress-reco/theme-cli -g
//用脚手架初始化我们的博客
theme-cli init 在这里写你的博客名字
//安装博客所需要的插件
npm install
//运行dev模式
npm run dev
yarn
# 初始化
yarn global add @vuepress-reco/theme-cli
theme-cli init
如果没有接触过脚手架的可以看这里
首先 theme-cli init myblog
然后 他会让你输入博客标题,可以在这里写,也可以最后在config.js里写,所以我就直接敲回车,等以后在配置,
下一条是输入博客描述,同上,下一条是博客作者,同上,下一条有三个选项blog(reco博客)、doc(文档)、可能是内置主题,因为我们用此项目做博客,所以选择blog
,回车后他会从代码库拉取博客模板,等待一会,可能回报一个错误,无视就好
- [2/3] Edit package.json(node:4820) UnhandledPromiseRejectionWarning: Error: Ca
nnot find module 'D:\test/myblog/docs/.vuepress/config.js'
拉取完成,我们就基本完成了安装步骤。
然后执行cd 你的博客名,进入到你的博客文件夹,在执行npm install安装依赖,可能会花一点时间,安装完成,就可以执行npm run devrun不能省略,等待出现localhost:8080,我们就可以在浏览器打开localhost:8080看到主题的效果。
配置
配置文件在你的博客文件夹下的.vuepress/config.js
module.exports = {
title: "vuepress-theme-reco", //这里是博客标题
description: 'A simple and beautiful vuepress blog theme .', //博客描述
dest: 'public', //博客部署时输出的文件夹
head: [
['link', { rel: 'icon', href: '/favicon.ico' }], //favicon图标设置
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }]
]
theme: 'reco', //vuepress挂载的主题
themeConfig: {
//导航栏
nav: [
{ text: 'Home', link: '/', icon: 'reco-home' }, //text:导航标题内容,icon:图标样式
{ text: 'TimeLine', link: '/timeline/', icon: 'reco-date' },
{ text: 'Docs',
icon: 'reco-message',
items: [
{ text: 'vuepress-reco', link: '/docs/theme-reco/' } //item: 子导航
]
},
{ text: 'Contact',
icon: 'reco-message',
items: [
{ text: 'GitHub', link: 'https://github.com/recoluan', icon: 'reco-github' }
]
}
],
//侧边栏设置
sidebar: {
'/docs/theme-reco/': [
'',
'theme',
'plugin',
'api'
]
},
type: 'blog',
// 博客设置
blogConfig: {
category: {
location: 2, // 在导航栏菜单中所占的位置,默认2
text: 'Category' // 默认 “分类”
},
tag: {
location: 3, // 在导航栏菜单中所占的位置,默认3
text: 'Tag' // 默认 “标签”
}
},
//友情链接
friendLink: [
{
title: '午后南杂',
desc: 'Enjoy when you can, and endure when you must.',
email: '1156743527@qq.com',
link: 'https://www.recoluan.com'
},
{
title: 'vuepress-theme-reco',
desc: 'A simple and beautiful vuepress Blog & Doc theme.',
avatar: "https://vuepress-theme-reco.recoluan.com/icon_vuepress_reco.png",
link: 'https://vuepress-theme-reco.recoluan.com'
},
],
//博客自定义LOGO
logo: '/logo.png',
// 搜索设置
search: true,
searchMaxSuggestions: 10,
// 自动形成侧边导航
// sidebar: 'auto',
// 最后更新时间
lastUpdated: 'Last Updated',
// 作者
author: 'reco_luan',
// 作者头像
authorAvatar: '/avatar.png',
// 备案号
record: 'xxxx',
// 项目开始时间
startYear: '2017'
/**
* 密钥 (if your blog is private)
*/
//私有仓库key和密码
// keyPage: {
// keys: ['your password'],
// color: '#42b983',
// lineColor: '#42b983'
// },
/**
*评论
* valine 设置 (if you need valine comment )
*/
// valineConfig: {
// appId: '...',// your appId
// appKey: '...', // your appKey
// }
},
markdown: {
lineNumbers: true
}
}
更多配置请详见博客配置
插件
此主题支持vuepress插件以及插件广场中的插件,插件广场
这个是我的配置,大家可以参考
module.exports = {
base: '/glassyskyblog/',
locales: {
'/': {
lang: 'zh-CN'
}
},
title: '远方有你伴余生',
description: '愿时光能缓,愿故人不散!',
dest: 'public',
head: [
['link', { rel: 'icon', href: '/favicon.ico' }],
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }]
],
theme: 'reco',
themeConfig: {
author: '远方有你伴余生',
nav: [
{ text: '主页', link: '/', icon: 'reco-home' },
{ text: '时间轴', link: '/timeline/', icon: 'reco-date' },
{ text: '工具推荐',
icon: 'reco-message',
items: [
{ text: 'codeSandbox', link: 'https://codesandbox.io',icon: 'reco-coding' },
{ text: '正则表达式手册', link: 'https://tool.oschina.net/uploads/apidocs/jquery/regexp.html', icon: 'reco-coding' }
]
},
{ text: '关于',
icon: 'reco-message',
items: [
{ text: 'GitHub', link: 'https://github.com/glassy-sky-lisong', icon: 'reco-github' },
{ text: '博客园', link: 'https://cnblogs.com/glassysky', icon: 'reco-bokeyuan' },
{ text: '掘金', link: 'https://juejin.im', icon: 'reco-juejin' },
{ text: '哔哩哔哩', link: 'https://space.bilibili.com/476991968', icon: 'reco-bilibili' },
{ text: '码云', link: 'https://gitee.com/glassyskyforgame', icon: 'reco-mayun' },
{ text: 'Twitter', link: 'https://twitter.com/GLASSYSKY113', icon: 'reco-twitter' }
]
}
],
sidebar: {
'/docs/theme-reco/': [
'',
'theme',
'plugin',
'api'
]
},
type: 'blog',
// 博客设置
blogConfig: {
category: {
location: 2, // 在导航栏菜单中所占的位置,默认2
text: '分类' // 默认 “分类”
},
tag: {
location: 3, // 在导航栏菜单中所占的位置,默认3
text: '标签' // 默认 “标签”
}
},
friendLink: [
{
title: '午后南杂',
desc: 'Enjoy when you can, and endure when you must.',
email: '1156743527@qq.com',
link: 'https://www.recoluan.com'
},
{
title: '远方有你伴余生',
desc: '愿时光能缓,愿故人不散!',
avatar: "https://vuepress-theme-reco.recoluan.com/icon_vuepress_reco.png",
link: 'https://vuepress-theme-reco.recoluan.com'
},
],
logo: '/logo.png',
// 搜索设置
search: true,
searchMaxSuggestions: 10,
// 自动形成侧边导航
// sidebar: 'auto',
// 最后更新时间
lastUpdated: '最后更新时间',
// 作者
author: '远方有你伴余生',
// 作者头像
authorAvatar: '/avatar.png',
// 备案号
record: ' 远方有你伴余生',
// 项目开始时间
startYear: '2017',
/**
* 密钥 (if your blog is private)
*/
// keyPage: {
// keys: ['your password'],
// color: '#42b983',
// lineColor: '#42b983'
// },
/**
* valine 设置 (if you need valine comment )
*/
valineConfig: {
appId: 'uVX1RdW5NvC6zEnfjERU7mAb-gzGzoHsz',// your appId
appKey: 'DzzpF7cokBfNP107e5OjMKtQ', // your appKey
}
},
markdown: {
lineNumbers: true
},
plugins: [
[
//先安装在配置, npm install @vuepress-reco/vuepress-plugin-kan-ban-niang --save
"@vuepress-reco/vuepress-plugin-kan-ban-niang",
{
theme: ['blackCat', 'whiteCat', 'haru1', 'haru2', 'haruto', 'koharu', 'izumi', 'shizuku', 'wanko', 'miku', 'z16'],
clean: false,
messages: {
welcome: '我是lookroot欢迎你的关注 ',
home: '心里的花,我想要带你回家。',
theme: '好吧,希望你能喜欢我的其他小伙伴。',
close: '再见哦'
},
width: 240,
height: 352
}
],
[
//先安装在配置, npm install @vuepress-plugin-meting --save
'meting', {
metingApi: "https://api.i-meto.com/meting/api",
meting: {
server: "netease",
type: "playlist",
mid: "621465725"
}, // 不配置该项的话不会出现全局播放器
aplayer: {
lrcType: 3
}
}
],
[
//彩带背景 先安装在配置, npm install vuepress-plugin-ribbon --save
"ribbon",
{
size: 90, // width of the ribbon, default: 90
opacity: 0.8, // opacity of the ribbon, default: 0.3
zIndex: -1 // z-index property of the background, default: -1
}
],
[
//鼠标点击特效 先安装在配置, npm install vuepress-plugin-cursor-effects --save
"cursor-effects",
{
size: 3, // size of the particle, default: 2
shape: ['circle'], // shape of the particle, default: 'star'
zIndex: 999999999 // z-index property of the canvas, default: 999999999
}
],
[
//动态标题 先安装在配置, npm install vuepress-plugin-dynamic-title --save
"dynamic-title",
{
showIcon: "/favicon.ico",
showText: "(/≧▽≦/)咦!又好了!",
hideIcon: "/failure.ico",
hideText: "(●—●)喔哟,崩溃啦!",
recoverTime: 2000
}
],
[
//图片放大插件 先安装在配置, npm install @vuepress\plugin-medium-zoom --save
'@vuepress\plugin-medium-zoom', {
selector: '.page img',
delay: 1000,
options: {
margin: 24,
background: 'rgba(25,18,25,0.9)',
scrollOffset: 40
}
}
],
[
//插件广场的流程图插件 先安装在配置 npm install vuepress-plugin-flowchart --save
'flowchart'
],
[
//插件广场的sitemap插件 先安装在配置 npm install vuepress-plugin-sitemap --save
'sitemap', {
hostname: 'https://www.glassysky.site'
}
],
['@vuepress/pwa', {
serviceWorker: true, //vuepress插件PWA 先安装在配置 npm install @vuepress/pwa --save
updatePopup: {
message: "发现新内容可用",
buttonText: "刷新"
}
}
],
["vuepress-plugin-nuggets-style-copy", {
copyText: "复制代码", //vuepress复制粘贴提示插件P 先安装在配置 npm install vuepress-plugin-nuggets-style-copy --save
tip: {
content: "复制成功!"
}
}],
["@vuepress-yard/vuepress-plugin-window",{
title: "远方有你伴余生の公告", //vuepress公告插件 先安装在配置 npm install @vuepress-yard/vuepress-plugin-window --save
contentInfo: {
title: "欢迎进来的小耳朵 ",
needImg: true,
imgUrl: "https://reinness.com/avatar.png",
content: "喜欢博皮可以到博客园关注教程",
contentStyle: ""
},
bottomInfo: {
btnText: '关于',
linkTo: 'https://cnblogs.com/glassysky'
},
closeOnce: false
}]
]
}
码字不易,喜欢本篇教程的话给个推荐或者关注,么么哒
VuePress博客美化之reco主题的更多相关文章
- Hexo博客搭建以及Next主题美化的经验之谈
这并不是一篇博客搭建教程.内容主要包含个人对于Hexo博客搭建的心得,Next6.0主题美化的部分建议,以及摘录一些各种用于博客搭建的link. 在博客园3年6个月,确实也学到了很多,博客园也是目前为 ...
- Hexo博客Next v7.X 主题升级,美化警示录
本文转载于:Hexo博客Next v7.X 主题升级,美化警示录丨奥怪的小栈 前言 经历了好几天(懒癌晚期懒得数了)的与主题升级斗争后,我终于完成基本上完成了next主题的升级!升到了V7.3!哈哈哈 ...
- VuePress 博客之 SEO 优化(三)标题、链接优化
前言 在 <一篇带你用 VuePress + Github Pages 搭建博客>中,我们使用 VuePress 搭建了一个博客,最终的效果查看:TypeScript 中文文档. 本篇讲讲 ...
- WordPress免费清新响应式博客/杂志/图片三合一主题Nana
WordPress免费清新响应式博客/杂志/图片三合一主题Nana 一.主题安装须知 1.本主题必须安装文章点击统计插件:WP-PostViews,可以直接在后台插件→安装插件中直接搜索安装官方最新版 ...
- 【博客美化】08.添加"扩大/缩小浏览区域大小" 按钮
博客园美化相关文章目录: [博客美化]01.推荐和反对炫酷样式 [博客美化]02.公告栏显示个性化时间 [博客美化]03.分享按钮 [博客美化]04.自定义地址栏logo [博客美化]05.添加Git ...
- 【博客美化】06.添加QQ交谈链接
博客园美化相关文章目录: [博客美化]01.推荐和反对炫酷样式 [博客美化]02.公告栏显示个性化时间 [博客美化]03.分享按钮 [博客美化]04.自定义地址栏logo [博客美化]05.添加Git ...
- 【博客美化】05.添加GitHub链接
博客园美化相关文章目录: [博客美化]01.推荐和反对炫酷样式 [博客美化]02.公告栏显示个性化时间 [博客美化]03.分享按钮 [博客美化]04.自定义地址栏logo [博客美化]05.添加Git ...
- 【博客美化】04.自定义地址栏logo
博客园美化相关文章目录: [博客美化]01.推荐和反对炫酷样式 [博客美化]02.公告栏显示个性化时间 [博客美化]03.分享按钮 [博客美化]04.自定义地址栏logo [博客美化]05.添加Git ...
- github搭建个人博客 hexo框架 next主题
之前就想搭建自己的博客,现在终于得以实施. 参考了多篇博客,然后又在虚拟机了往往复复试了好多次, 现在基本搭建完毕. 我是基于hexo博客框架, next主题搭建的博客, 静态网页. 大体就是, ...
随机推荐
- TreeMap实现
- Java项目开启远程调试(tomcat、springboot)
当我们运行一个项目的时候,一般都是在本地进行debug.但是如果是一个分布式的微服务,这时候我们选择远程debug是我们开发的利器. 环境apache-tomcat-8.5.16 Linux 如何启用 ...
- nginx配置奇怪问题记录
执行 nginx -t 检查配置报了如下错误: 下面是配置信息 遇到个很奇怪的问题,plm-api-stage 这么配置就可以正常校验过,但是改成 plm-stage-api,就会上面的警告信息: ...
- pycharm中连接MySql出现 Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决
具体异常如下: 这个异常特别烦人,是mysql连接驱动的问题,可以用二步解决: 第一步 从网上下载驱动,从mysql-connector-java_8.0.16-1ubuntu16.04_all.de ...
- mmdetection源码剖析(1)--NMS
mmdetection源码剖析(1)--NMS 熟悉目标检测的应该都清楚NMS是什么算法,但是如果我们要与C++和cuda结合直接写成Pytorch的操作你们清楚怎么写吗?最近在看mmdetectio ...
- 美国6w刀的远程工作高级工程师职位,说下在线评估, 倒在第一阶段, 认知能力测试?智商不够怎么办?!
前几天刚被裁员了, 然后在Linkedin上面看到一个crossover的senior software engineer的职位,写的可以remote, 6w刀, 我第一次参加这个公司的这种在线测试, ...
- 每日一题 - 剑指 Offer 31. 栈的压入、弹出序列
题目信息 时间: 2019-06-25 题目链接:Leetcode tag:栈 难易程度:中等 题目描述: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入 ...
- 与跨域相关的 jsonp 劫持与 CORS 配置错误
参考文章: CORS(跨域资源共享)错误配置漏洞的高级利用 JSONP劫持CORS跨源资源共享漏洞 JSONP绕过CSRF防护token 读取型CSRF-需要交互的内容劫持 跨域资源共享 CORS 详 ...
- CD题解(药水的选择)
这道题显然是一个01背包加上记录路径的题目,要说这道题的原型就是N多年前的CD 本题主要考的就是对01背包的基础板子加上稍微一点点的码力,就可以A掉这个题了 废话不多说,上代码: #include&l ...
- 2-ADC