Skip to content

Commit

Permalink
๐Ÿž fix: #76
Browse files Browse the repository at this point in the history
  • Loading branch information
็™ฝไบ‘่‹็‹— committed Apr 4, 2023
1 parent 10a0df0 commit 4189f54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package/hexo-theme-async/layout/_partial/page/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<div class="row hidden-sm">
<%
let cards = []
let categories = site.categories.toArray()
if (Array.isArray(theme.categorie_card.list)) {
theme.categorie_card.list.forEach(title => {
let categorie = site.categories.data.find(item=> item.name === title)
let categorie = categories.find(item=> item.name === title)
if(categorie) cards.push(categorie)
})
} else {
cards = site.categories.data.sort((a,b)=>b.length-a.length).slice(0,theme.categorie_card.len)
cards = categories.sort((a,b)=>b.length-a.length).slice(0,theme.categorie_card.len)
}
%>
<% cards.forEach((item,index) => { %>
Expand Down

0 comments on commit 4189f54

Please sign in to comment.