theme-materialized / hexo-theme-materialized

A cool materialized theme for Hexo
https://theme-materialized.github.io
38 stars 9 forks source link

针对每篇文章配置前题到问题 #5

Open liuwei1993 opened 4 years ago

liuwei1993 commented 4 years ago

今天首次使用theme-materialized主题,但是遇到针对每篇文章配置前题到问题 在博主的 readme 文档中写明 Article/Page Front-matter 的配置为

thumbnail: /xxx.jpg # Custom page header image. author: xxx # Author. categories: [xxx] # Categories. Support more than one categories. tags: # Tags.

但未说明具体该配置文件放在哪个目录,请告知~

liuwei1993 commented 4 years ago

/Users/simonliu/blog/liuwei1993.github.io/themes/materialized/layout/_partial/article.ejs:45 43| <li class="mdui-menu-item" disabled 44| <% if (theme.qrcode.use === 'plugin') { % 45| <img src="<%- qrcode(page.permalink, {margin: 2}) %" 46| <% } else { % 47| 48| <% } %>

qrcode is not defined 这是我遇到的报错

code004Accepted commented 4 years ago

您好,请您确认您已经安装了hexo-helper-qrcode插件 (README: If use plugin, hexo-helper-qrcode plugin is needed)

另外:关于front-matter的问题,您可以参考邮件的回复,或者参考Hexo官方文档中相关部分

code004Accepted commented 4 years ago

补充:该配置文件是在文章内容前面的

示例:

---
title: 测试文章 # 文章标题
tags: 
  - 测试标签1
  - 测试标签2
categories: [测试分类]
thumbnail: xxx.jpg # 标题图
author: example # 本文单独的作者姓名
qrcode: false # 本文是否启用二维码
---
这里是文章正文的Markdown代码
**测试粗体**

值得注意的是,这些文章front-matter中的设置是只用于该文章的,比如定义author选项并不会影响其他文章的作者显示。如果想按照_config.yml中设置的作者显示,可以不用在文章front-matter中定义此选项。在不定义的前提下,这些都会按照_config.yml的设置来生成。

如果这方面还存在困难,建议您忽略该部分的设置,文章front-matter只用按hexo官方的教程指定标题、时间、标签、分类等,其他设置会直接参照_config.yml中的设置。

weizhenhuan commented 3 years ago

请问更换主题后, 点不开我的文章怎么回事. 就是主界面是好的, 但打开我写得博客时就是空白页.

code004Accepted commented 3 years ago

请问更换主题后, 点不开我的文章怎么回事. 就是主界面是好的, 但打开我写得博客时就是空白页.

您好,请问您是指更换至theme-materialized后出现该问题吗?

另外,为了我们更好地帮助您解决问题,烦请您给出您博客的链接,谢谢