Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

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

Open
liuwei1993 opened this issue Dec 10, 2019 · 5 comments
Open

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

liuwei1993 opened this issue Dec 10, 2019 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@liuwei1993
Copy link

今天首次使用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.

  • xxx
    qrcode: false # Disable article qrcode.
    share_menu: false # Disable article share menu.
    license: xxx # License description of the article.
    donate: false # Disable article donate link.
    toc: true # Enable article toc.
    comments: true # Enable article comment.

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

@liuwei1993
Copy link
Author

/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
Copy link
Collaborator

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

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

@code004Accepted code004Accepted self-assigned this Dec 10, 2019
@code004Accepted
Copy link
Collaborator

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

示例:

---
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中的设置。

@code004Accepted code004Accepted added the help wanted Extra attention is needed label Aug 4, 2020
@weizhenhuan
Copy link

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

@code004Accepted
Copy link
Collaborator

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

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants