change theme to buck
This commit is contained in:
parent
014b4f6dc7
commit
88da620079
99 changed files with 2197 additions and 38 deletions
13
themes/buck/scripts/tags.js
Normal file
13
themes/buck/scripts/tags.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
hexo.extend.helper.register("tags_of_year", function (year) {
|
||||
const yearNumber = Number(year)
|
||||
const tags = this.site.posts
|
||||
.filter((post) => post.date.year() === yearNumber)
|
||||
.map((x) => x.tags)
|
||||
.reduce((p, c) => {
|
||||
for (const t of c.toArray()) {
|
||||
p.add(t)
|
||||
}
|
||||
return p
|
||||
}, new Set())
|
||||
return Array.from(tags);
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue