Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加副标题可以为列表,每次随机选择一项的功能 #1092

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions layout/_partials/header/banner.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ var banner_img = page.banner_img || theme.index.banner_img
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
var banner_mask_alpha = parseFloat(page.banner_mask_alpha || theme.index.banner_mask_alpha)
var subtitle = page.subtitle || page.title
// 如果subtitle是数组,就将其自己赋值为其自己的其中随机一个元素
if (Array.isArray(subtitle)) {
subtitle = subtitle[Math.floor(Math.random() * subtitle.length)]
}
%>

<div id="banner" class="banner" <%- theme.banner && theme.banner.parallax && 'parallax=true' %>
Expand Down
Loading