Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Fix date sorting issue
Browse files Browse the repository at this point in the history
Which mentioned [here](auroral-ui#224)
  • Loading branch information
moziar committed Dec 25, 2022
1 parent 26a1783 commit 291fa75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/lib/generators/category.js
Expand Up @@ -15,6 +15,11 @@ class CategoryGenerator {
this.posts = posts
this.configs = configs
this.reduceCategories()
for(let cat of this.data) {
cat.data.postlist.sort(function (a, b) {
return a.date< b.date? 1 : -1;
})
}
}

addCategories(data) {
Expand Down
5 changes: 5 additions & 0 deletions scripts/lib/generators/tag.js
Expand Up @@ -15,6 +15,11 @@ class TagGenerator {
this.posts = posts
this.configs = configs
this.reduceTags()
for(let cat of this.data) {
cat.data.postlist.sort(function (a, b) {
return a.date< b.date? 1 : -1;
})
}
}

reduceTags() {
Expand Down

0 comments on commit 291fa75

Please sign in to comment.