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:
499
499
slogan :
500
500
enable : true
501
501
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
504
504
text : " An elegant Material-Design theme for Hexo"
505
505
506
506
# 通过 API 接口作为首页副标题的内容,必须返回的是 JSON 格式,如果请求失败则按 text 字段显示,该功能必须先开启 typing 打字机功能
Original file line number Diff line number Diff line change 40
40
typing (text);
41
41
}
42
42
})
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]);
43
47
< % } else { % >
44
48
typing (text);
45
49
< % } % >
You can’t perform that action at this time.
0 commit comments