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主题搭建的博客, 静态网页. 大体就是, ...
 
随机推荐
- Myeclipse启动WebLogic 总是报账号密码无效<Authentication denied: Boot identity not valid
			
在MyEclipse下配置了Weblogic 11后,每次启动从报错: Critical> 看了下描述,是用户名及密码什么的问题,我想起来,配置Weblogic 的域的时候将密码改成了12345 ...
 - 【部分】ASP.NET MVC5 - 地址栏传参两种方法
			
地址栏传参两种方法 1- Home/Index/88 (后台控制器读取需要一样的参数名称) 2- Home/Index?id1=88?id2=99 (Request三种接受方法) ...
 - HTML重构与网页常用工具
			
下面这张思维导图,是我对全书大体内容的一个概括性总结: 工具 本书推荐的工具主要包含的是自动化测试,但是我觉得现行的开发环节当中实际用到的会比较少.这里就推荐一下其他方面的优秀工具: 1. YSlow ...
 - 【科普】Scrum——从橄榄球争球到敏捷开发
			
对敏捷开发Scrum稍有了解的都知道Scrum来源于橄榄球,但你知道为何要以这项球类运动的术语来命名这个敏捷开发方法论吗? Scrum与橄榄球对应关系 Scrum 一词源于英式橄榄球运动,是指双方球员 ...
 - spring boot 整合Thymeleaf模板
			
SpringBoot 是为了简化 Spring 应用的创建.运行.调试.部署等一系列问题而诞生的产物,自动装配的特性让我们可以更好的关注业务本身而不是外部的XML配置,我们只需遵循规范,引入相关的依赖 ...
 - linux test tool--"ab"
			
install(ubuntu os): sudo apt-get install apache2-utils usage: ab -c 200 -t 100 http://localhost:8001 ...
 - 每日一题 - 剑指 Offer 44. 数字序列中某一位的数字
			
题目信息 时间: 2019-07-01 题目链接:Leetcode tag: 规律 难易程度:中等 题目描述: 数字以0123456789101112131415-的格式序列化到一个字符序列中.在这个 ...
 - C语言学习笔记——特别篇(VScode安装使用)
			
B站有同步教学视频 参考博文: https://www.cnblogs.com/czlhxm/p/11794743.html 注意事项: 请在英文目录下运行!!! VScode下载链接: https: ...
 - Intellij idea2020永久激活,亲测可用!!!(持续更新)
			
DEA 2020 破解 IntelliJ IDEA 2020最新激活码(亲测有效,可激活至 2089 年,持续更新~) 申明:本教程 IntelliJ IDEA 破解补丁.激活码均收集于网络,请勿商用 ...
 - hbase2.1.9 centos7 完全分布式 搭建随记
			
hbase2.1.9 centos7 完全分布式 搭建随记 这里是当初在三个ECS节点上搭建hadoop+zookeeper+hbase+solr的主要步骤,文章内容未经过润色,请参考的同学搭配其他博 ...