1. Feature: random cover #10

2. Fix: valine lang not work
3. Fix: archives page site name not change when the language change
4. Fix: related posts url error
This commit is contained in:
hwy0127@gmail.com
2019-07-06 20:15:31 +08:00
Unverified
parent dfdd3289bb
commit 0a1d8b0eba
16 changed files with 50 additions and 2600 deletions

13
scripts/random_cover.js Normal file
View File

@@ -0,0 +1,13 @@
hexo.extend.helper.register('random_cover', function () {
var cover;
var num;
if (!Array.isArray(hexo.theme.config.default_cover)) {
cover = hexo.theme.config.default_cover
return cover
} else {
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
cover = hexo.theme.config.default_cover[num];
return cover
}
})