xaoxuu / hexo-theme-stellar

内置文档系统的简约商务风Hexo主题,支持大量的标签组件和动态数据组件。
https://xaoxuu.com/wiki/stellar/
MIT License
1.26k stars 313 forks source link

post_card.ejs 和 post.ejs 的标题逻辑不一致 #352

Closed JackAtlas closed 7 months ago

JackAtlas commented 7 months ago
// layout/post.ejs
// 第 9 行
const title = page.h1 != null ? page.h1 : page.title;
// layout/_partial/main/post_list/post_card.ejs
// 第 49 行
el += (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, config.date_format);

导致问题:即使文章设置了 h1,列表里显示的还是 title。

这是故意的还是不小心 doge?

xaoxuu commented 7 months ago

title一般都是要有的,不然rss或者其他插件会识别不到,h1用来覆盖页面内显示的大标题,seo_title是以前的写法,后续再梳理一下逻辑吧

JackAtlas commented 7 months ago

嗯,我明白,在页面内,应该是显示 h1 字段优先于 title 字段。

类似的还有侧边栏的“最近更新”组件、归档的列表等有需要显示文章标题的地方,也是显示了 title 而不是 h1。

github-actions[bot] commented 7 months ago

:wave: Hello, This issue has been marked as resolved. If there are other issues, please contact us with a new issue.

:wave: 您好, 此 issue 已经被标记为已解决,如果还有其它问题,请提出新的 issue 联系我们。