基于GithubHexo的个人博客搭建过程 (3)

基于GithubHexo的个人博客搭建过程

8、 Next 配置

当然,最权威的是看,我在这里提供一个示例,供大家参考,你可以直接拷过去稍微改动一点就行。

Next 配置就是上面所说的”主题配置文件“,位于 xxx.github.io/themes/next 目录下,文件名为 _config.yml。老规矩,先备份一份 ”_config.yml.bak“,以防改错。

以我的博客为例,阐述一下需要配置的地方:

# Set default keywords (Use a comma to separate) # 设置关键字 keywords: "Android, DIY" # Specify the date when the site was setup # 设置博客开始时间 since: 2017 # When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash (/archives -> archives) # 设置菜单,就是[我的博客]()左侧那一列 menu: #home: / home: / || home archives: /archives/ || archive #archives: /archives categories: /categories/ || th #categories: /categories tags: /tags/ || tags #tags: /tags about: /about/ || user #about: /about #schedule: /schedule/ || calendar #sitemap: /sitemap.xml || sitemap #commonweal: /404/ || heartbeat # Schemes # 设置风格 #scheme: Muse #scheme: Mist scheme: Pisces # 我的就是这个双栏风格 # Automatically Excerpt. Not recommand. # Please use <!-- more --> in the post to control excerpt accurately. auto_excerpt: enable: true # 设置是否显示阅读全文,文章较多的话,有必要设置为 true length: 150 # 一些第三方服务设置,这里只提一下”多说“,其他的请参考官方介绍 # Make duoshuo show UA # user_id must NOT be null when admin_enable is true! # you can visit get duoshuo user id. duoshuo_info: ua_enable: true admin_enable: true user_id: 0 # **这里不要动,千万别动** admin_nickname: DIY-green # Code Highlight theme # Available value: # normal | night | night eighties | night blue | night bright # https://github.com/chriskempson/tomorrow-theme #highlight_theme: normal # 代码高亮主题 highlight_theme: night eighties # 打赏配置 # 打赏说明文本 reward_comment: 坚持原创技术分享,您的支持将鼓励我继续创作! # 微信收款二维码 wechatpay: /uploads/pay/wechatpay.jpg # 支付宝收款二维码 alipay: /uploads/pay/alipay.jpg # 订阅微信公众号 # Wechat Subscriber #wechat_subscriber: # enabled: true # qcode: /uploads/wechat-qcode.jpg # description: 欢迎您扫一扫上面的微信公众号,订阅我的博客!

(PS:在设置菜单这一项,就是我的博客左侧那一列就使用默认的设置就可以了,之前改成了注释的部分,导致菜单栏的图标都变成了问号,谢谢帅张星球的“少年”提醒经过改正,以上。)

9. 创建分类页面

(1)打开命令行,定位到 Daotin.github.io 目录;
(2)新建一个页面,命名为 categories;

hexo new page categories

(3)根据提示找到新建的 index.md 文件,编辑;

--- title: 分类 date: 2017-10-30 20:45:01 type: "categories" # 将页面的类型设置为 categories,主题将自动为这个页面显示所有分类 comments: false # 如果有启用多说 或者 Disqus 评论,默认页面也会带有评论。需要关闭的话,设置为 false --- 10. 创建标签云页面

如下图:

基于GithubHexo的个人博客搭建过程

(1)打开命令行,定位到 Daotin.github.io 目录;
(2)新建一个页面,命名为 tags;

hexo new page tags

(3)根据提示找到新建的 index.md 文件,编辑;

--- title: All tags date: 2016-04-27 08:56:40 type: "tags" # 将页面的类型设置为 tags,主题将自动为这个页面显示标签云 comments: false # 如果有启用多说 或者 Disqus 评论,默认页面也会带有评论。需要关闭的话,设置为 false ---

注意事项

格式再次强调,设置项的键值之间一定要有空格;

菜单上显示 ”分类“ 等栏目。如果需要在菜单上显示 ”分类“ 和 ”标签“ 等,那么记得打开注释,或者添加该条目;

关于第三方服务的 ”duoshuo_info“。在配置该项的时候,user_id 键对应的值不要修改,也就是保持为 0,具体原因我不清楚,如果修改了该值,那么你的博客会变得一片空白;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzpwjg.html