使用Md写作软件写作,完成后转为源码格式导入博客
请优先参考 Markdown官方文档 或 中文文档
下面是预先定义的参数,可在模板中使用这些参数值并加以利用。
参数描述
layout布局 title标题 date建立日期 updated更新日期 comments开启文章的评论功能
tags标签(不适用于分页)categories分类(不适用于分页)permalink覆盖文章网址
其中,分类和标签需要区别一下,分类具有顺序性和层次性,也就是说Foo,Bar不等于Bar,Foo;而标签没有顺序和层次。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| --- title: Hexo+Github博客搭建记录 date: 2019-08-10 21:44:44 author: 洪卫 img: /medias/banner/7.jpg coverImg: /medias/banner/7.jpg top: true cover: true toc: true password: 5f15b28ffe43f8be4f239bdd9b69af9d80dbafcb20a5f0df5d1677a120ae9110 mathjax: true summary: 这是你自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字,否则程序会自动截取文章的部分内容作为摘要 tags: - Hexo - Github - 博客 categories: - 软件安装与配置 ---
|
布局
默认使用post布局,存入_post文件夹,与自定义同
1 2 3 4 5
| hexo new [layout] <title> hexo new page newdraft #另起一页 hexok new draft newdraft #草稿,不会显示出来 hexo sever --draft #预览草稿 hexo publish draft newpage #将newdraft写入post中
|
更换主题
1
| https://github.com/blinkfox/hexo-theme-matery #推荐的主题
|
添加404页面 于source目录 404.md
1 2 3 4 5
| title: 404 date: 2019-08-5 16:41:10 type: "404" layout: "404" description: "Oops~,我崩溃了!找不到你想要的页面 :("
|
然后在/themes/matery/layout/目录下新建一个404.ejs文件,内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <style type="text/css"> .about-cover { height: 75vh; } </style>
<div class="bg-cover pd-header about-cover"> <div class="container"> <div class="row"> <div class="col s10 offset-s1 m8 offset-m2 l8 offset-l2"> <div class="brand"> <div class="title center-align"> 404 </div> <div class="description center-align"> <%= page.description %> </div> </div> </div> </div> </div> </div>
<script> $('.bg-cover').css('background-image', 'url(/medias/banner/' + new Date().getDay() + '.jpg)'); </script>
|
插入音乐
1 2
| <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=186018&auto=1&height=66"></iframe> //其中的width=298 height=52 均改为0就看不到了,依然可以播放音乐
|
引用:
Hexo+Github: 个人博客网站搭建完全教程(看这篇就够了)
搭建Hexo博客进阶篇–API和一些小部件(四)