Skip to content

Commit

Permalink
refactor(layout): 修改 TypeIt 脚本加载条件
Browse files Browse the repository at this point in the history
- 将 TypeIt 脚本加载条件从 theme.typeit || theme.hometop.banner.text.enable 修改为 theme.typeit || typeof theme.hometop.banner.desc === 'object'
- 这个修改确保了只有在 theme.hometop.banner.desc 是对象类型时才加载 TypeIt 脚本,提高了代码的准确性和性能
  • Loading branch information
everfu committed Jan 7, 2025
1 parent 07cb3aa commit 23d1e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layout/includes/inject/body.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ div
if theme.chart
script(src=url_for(theme.cdn.chart_js))

if theme.typeit || theme.hometop.banner.text.enable
if theme.typeit || typeof theme.hometop.banner.desc === 'object'
script(src=url_for(theme.cdn.typeit_js))

if theme.display_mode.universe
Expand Down

0 comments on commit 23d1e1f

Please sign in to comment.