记录搭建博客出现的问题
1. 部分文章的图片不显示
- 路径问题,存图片的文件夹不能有空格
2. 图片名称重复显示
大概就是这样,然后F12查看代码
图片名显示两次(一次在 alt
,一次在
figcaption
)。
这里采用的方法是把在 figcaption
的隐藏掉
步骤
打开
themes/matery/layout/_partial/post-detail.ejs
在
1
文章最开头直接复制
里面添加:
1
2
3
4
5<style>
figure figcaption {
display: none ;
}
</style>
3. 行外公式正确显示,行内公式不行
打开 Matery 主题的
_config.yml
找到
math
相关配置```yaml mathjax: enable: true cdn: https://cdn.bootcss.com/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML
1
2
3
4
5
6
7
8
9
10
11
12
- 把这部分修改为:
- ```yaml
mathjax:
enable: true
cdn: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
options:
tex:
inlineMath: [["$", "$"], ["\\(", "\\)"]]
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
重新生成,正确显示
4. 超链接不显示(存疑)
问题:

解决:
打开
themes/matery/layout/_partial/post-detail.ejs
在
</body>
之前,替换为以下 JavaScript 代码:
1 | <script> |
- 保存后,重新生成博客
1 | hexo clean |
解决:
别直接cv链接,用
1 | [文章名](链接) |