以前介绍了hexo的安装和部署(还没部署的小伙伴点这里),这篇我们接着介绍怎么应用主题。css
这里主要是配置的是conci主题 效果点这里
同时支持pc端和移动端html
hexo的主题都存放在themes文件夹下,在themes文件夹下右键Git bash Here,输入:git
$ git clone https://github.com/cspp01/concise.git
而后在主_config.yml文件中找到theme字段改成concise。github
因为我是用的是scss写的css代码,因此先安装sass插件。在主根目录下右键Git bash Here,输入npm
npm install hexo-renderer-sass --save
在主根目录下右键Git bash Here,输入sass
npm install hexo-generator-mypage --save
而后在主_config.yml中添加以下bash
mypage: tags/index.html: tags categories/index.html: categories about.html: about
基本条件已经OK,能够预览了。输入:微信
$ hexo clean $ hexo s -debug
在本地预览调试看看是否应用成功。hexo
在主题配置文件中找到my_img字段.dom
my_img: http://ooa3lxrpg.bkt.clouddn.com/b.jpg?imageView2/1/w/120/h/120/q/75 //地址(云存储对应头像的地址)也可放在本地,不过推荐放云端存储。
在主题配置文件中找到logo字段
logo: conci #<img src="./logo.png">//能够是字符也能够是图片如(<img src="你的logo地址">)
把主题source文件夹下的favicon.ico替换或者在主题配置文件中找到favicon字段把地址换成你的地址
favicon: /favicon.ico
找到inf字段来对应设置你要展现的信息
inf: name: conci.theme superscript: hexo//上标字段 describe: one: conci version 1.0.0//第一行信息 two: Simple and practical hexo personal blog theme.//第2行信息 three: The freedom to choose//第3行信息
找到my_social字段来对应设置你要展现的信息
my_social: github: https://github.com/cspp01 twitter: / weibo: http://weibo.com/5262373626/profile?topnav=1&wvr=6&is_all=1 豆瓣: http://douban.com/people/160374034/ 知乎: http://www.zhihu.com/people/cc-chen-4-85
找到my_links字段来按格式设置,要设置几个友情连接就设置几个
my_links: ccblog1://友情连接名字 href: //友情连接地址 img: http://ooa3lxrpg.bkt.clouddn.com/timg.jpg//友情连接头像地址 ccblog2://友情连接名字 href: //友情连接地址 img: http://ooa3lxrpg.bkt.clouddn.com/timg.jpg//友情连接头像地址
找到index_pagelength字段设置
index_pagelength: 200//字符数
找到reward字段设置
reward: open: true//[true(开启)|false(关闭)] weixing: http://ooa3lxrpg.bkt.clouddn.com/wx.jpg?imageView2/2/w/180 #你的微信收钱二维码图片地址 alipay: http://ooa3lxrpg.bkt.clouddn.com/zfb.jpg?imageView2/2/w/180 #你的支付宝收钱二维码图片地址
找到sidebar字段设置,注意两个属性的值必须相反
sidebar: content: left//内容位置[left|right] my: right//侧边栏位置[left|right]
在source _posts下的文章中在两个- - -之间添加
--- title: hexo的next主题配置和优化 date: 2017-03-14 08:15:23 tags: ['hexo','next','css'] //hexo和next就是标签,你能够写任何关于你文章名字的标签 categories: hexo博客搭建 //分类 pho: http://ooa3lxrpg.bkt.clouddn.com/11.jpg //首页展现图片地址,未配置的话会显示默认图片 ---