File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -499,8 +499,8 @@ index:
499499 slogan :
500500 enable : true
501501
502- # 为空则按 hexo config.subtitle 显示
503- # If empty, text based on `subtitle` in hexo config
502+ # 为空则按 hexo config.subtitle 显示,支持列表格式来实现随机选择一行文字显示
503+ # If empty, text based on `subtitle` in hexo config, support list format to random selection of a row for display
504504 text : " An elegant Material-Design theme for Hexo"
505505
506506 # 通过 API 接口作为首页副标题的内容,必须返回的是 JSON 格式,如果请求失败则按 text 字段显示,该功能必须先开启 typing 打字机功能
Original file line number Diff line number Diff line change 4040 typing (text);
4141 }
4242 })
43+ < % } else if (Array .isArray (theme .index .slogan .text ) && theme .index .slogan .text .length > 0 ) { % >
44+ var texts = < %- JSON .stringify (theme .index .slogan .text ) % > ;
45+ var idx = Math .floor (Math .random () * texts .length );
46+ typing (texts[idx]);
4347 < % } else { % >
4448 typing (text);
4549 < % } % >
You can’t perform that action at this time.
0 commit comments