diff --git a/themes/fluid/layout/404.ejs b/themes/fluid/layout/404.ejs index 174a1c5e..0f56d3fb 100644 --- a/themes/fluid/layout/404.ejs +++ b/themes/fluid/layout/404.ejs @@ -18,7 +18,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.page404.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 100) diff --git a/themes/fluid/layout/about.ejs b/themes/fluid/layout/about.ejs index 42574da6..daf5f45d 100644 --- a/themes/fluid/layout/about.ejs +++ b/themes/fluid/layout/about.ejs @@ -18,7 +18,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.about.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/archive.ejs b/themes/fluid/layout/archive.ejs index e83e1b9b..7daff1a6 100644 --- a/themes/fluid/layout/archive.ejs +++ b/themes/fluid/layout/archive.ejs @@ -18,7 +18,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.archive.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/categories.ejs b/themes/fluid/layout/categories.ejs index 8b5d04d7..c46a6371 100644 --- a/themes/fluid/layout/categories.ejs +++ b/themes/fluid/layout/categories.ejs @@ -20,7 +20,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.category.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/category.ejs b/themes/fluid/layout/category.ejs index a9cfc4c6..3ef6e72c 100644 --- a/themes/fluid/layout/category.ejs +++ b/themes/fluid/layout/category.ejs @@ -20,7 +20,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.category.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/links.ejs b/themes/fluid/layout/links.ejs index 7f3b6201..745498c6 100644 --- a/themes/fluid/layout/links.ejs +++ b/themes/fluid/layout/links.ejs @@ -19,7 +19,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.links.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/page.ejs b/themes/fluid/layout/page.ejs index f1818d67..208d513b 100644 --- a/themes/fluid/layout/page.ejs +++ b/themes/fluid/layout/page.ejs @@ -18,7 +18,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.page.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/post.ejs b/themes/fluid/layout/post.ejs index 527b30c1..4c1be3aa 100644 --- a/themes/fluid/layout/post.ejs +++ b/themes/fluid/layout/post.ejs @@ -15,7 +15,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.post.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/tag.ejs b/themes/fluid/layout/tag.ejs index 2f46b64e..358a0e99 100644 --- a/themes/fluid/layout/tag.ejs +++ b/themes/fluid/layout/tag.ejs @@ -20,7 +20,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.tag.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50) diff --git a/themes/fluid/layout/tags.ejs b/themes/fluid/layout/tags.ejs index 89b929bc..d84d2037 100644 --- a/themes/fluid/layout/tags.ejs +++ b/themes/fluid/layout/tags.ejs @@ -24,7 +24,7 @@ function hash(text) { } page.banner_group = page.banner_group || theme.tag.banner_group || theme.index.banner_group if (Array.isArray(page.banner_group) && page.banner_group.length) { - var index = hash(page.subtitle || page.title) % page.banner_group.length + var index = Math.abs(hash(page.subtitle || page.title)) % page.banner_group.length page.banner_img = page.banner_group[index].img || page.banner_img page.banner_text = page.banner_group[index].text || page.subtitle || page.title page.banner_img_height = parseFloat(page.banner_group[index].height || 50)