theme-kaze / hexo-theme-kaze

⛵ A responsive, modern Hexo theme
https://theme-kaze-demo.songhn.com/
MIT License
194 stars 17 forks source link

一级标题字号错误 #53

Closed owl-paw closed 3 years ago

owl-paw commented 3 years ago

Describe the bug 描述问题 一级标题样式显示错误

To Reproduce 如何复现 文章中添加一级标题后,部署到网页上时,一级标题显示的大小有问题,使用了默认的 16px,而没有放大。 Typora 中添加一级标题 image 网页上显示字号错误 image

Environment 使用环境

Additional context 额外信息 Add any other context about the problem here. 额外需要说明的内容

songhn233 commented 3 years ago

这样的区别是由于 Hexo 面向的是网页,而 front-matter 中的 title 会被作为一级标题,在实践中不建议采用多个一级标题,可见 MDN,这样是为了 SEO 等其他方面。

所以主题中的正文部分没有对一级标题做样式处理,也是这个考虑,同时需要注意使用一级标题配合某些语法会导致 Hexo 生成错误。如果你 Typora 中一直习惯一级标题并且修改成本过高,也认为多个一级标题是可以接受的,那么可以直接在本地的主题文件内进行修改,增加 h1 相关段落。

https://github.com/theme-kaze/hexo-theme-kaze/blob/b06d65f78ee9aae6049a23953a6504ecae95d6b2/source/css/_base/reset.styl#L9-L25

主题本身就不考虑在正文中处理一级标题样式了,因为按照预期应该只存在 title 一个一级标题。

owl-paw commented 3 years ago

感谢!