下面是如何搭建hexo和matery主题的静态博客。
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Create a new post
$ hexo new "My New Post"
More info: Writing
Run server
$ hexo server
More info: Server
Generate static files
$ hexo generate
More info: Generating
Deploy to remote sites
$ hexo deploy
More info: Deployment
文章 Front-matter 介绍
配置选项 | 默认值 | 描述 |
---|---|---|
title | Markdown 的文件标题 |
文章标题,强烈建议填写此选项 |
date | 文件创建时的日期时间 | 发布时间,强烈建议填写此选项,且最好保证全局唯一 |
author | 根 _config.yml 中的 author |
文章作者 |
img | featureImages 中的某个值 |
文章特征图 |
top | true | 推荐文章(文章是否置顶),如果 top 值为 true ,则会作为首页推荐文章 |
cover | false | 表示该文章是否需要加入到首页轮播封面中 |
coverImg | 无 | 表示该文章在首页轮播封面需要显示的图片路径,如果没有,则默认使用文章的特色图片 |
password | 无 | 文章阅读密码,如果要对文章设置阅读验证密码的话,就可以设置 password 的值,该值必须是用 SHA256 加密后的密码,防止被他人识破。前提是在主题的 config.yml 中激活了 verifyPassword 选项 |
toc | true | 是否开启 TOC,可以针对某篇文章单独关闭 TOC 的功能。前提是在主题的 config.yml 中激活了 toc 选项 |
mathjax | false | 是否开启数学公式支持 ,本文章是否开启 mathjax ,且需要在主题的 _config.yml 文件中也需要开启才行 |
summary | 无 | 文章摘要,自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字,否则程序会自动截取文章的部分内容作为摘要 |
categories | 无 | 文章分类,本主题的分类表示宏观上大的分类,只建议一篇文章一个分类 |
tags | 无 | 文章标签,一篇文章可以多个标签 |
实列
---
title: 基于Hexo的matery主题搭建博客
date: 2020-01-09 16:44:00
author: 微笑紫瞳星
img: /source/images/xxx.jpg
top: true
cover: true
coverImg: /images/1.jpg
password:
toc: false
mathjax: false
summary: 这是你自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字,否则程序会自动截取文章的部分内容作为摘要
categories: 工具
tags:
- blog
- hexo
hexo n “xxx” 创建md
关于hexo中主题Matery中网易云歌单不显示问题
网易云只能使用公共歌单,私人的歌单要登陆才行,我去github提交issue得到的答案,你可以试试这个歌单号 330695641 这是一个公共歌单。
https://music.163.com/#/playlist?id=330695641
你可以按照上面方法解决一下。成功了评论我一下,谢谢啦!
emm,反正我还是没成功,我用其他的音乐歌单都可以,现在还是在用qq音乐。
用hexo和Matery搭建个人静态博客
我搭建的时候参考了下面的链接,第一个链接去看去和使用git和github,但是第一个链接使用next主题,要想搭建matery主题参考第二个链接。
参考:https://zhuanlan.zhihu.com/p/102592286
https://github.com/blinkfox/hexo-theme-matery/blob/develop/README_CN.md
通过上面两个网址就可以完美的搭建出自己的静态博客了
但是如果你要搭建Matery主题博客时,这个博客里没有集成评论系统
我使用的是Valine做的评论系统,matery开发者大佬在其config中说到最好不要用gitalk,会导致别人攻击将你github,可能会将你的评论内容删除,
valine做评论参考下面链接
https://blog.csdn.net/blue_zy/article/details/79071414
如果要内嵌图片的话要使用下面样式的链接,同时安装npm install hexo-asset-image –save
参考链接:https://blog.csdn.net/u010996565/article/details/89196612
同时会创建一个文件,将图片放入该文件,如下方式引用
