diff --git a/package/hexo-theme-async/layout/_partial/page/index.ejs b/package/hexo-theme-async/layout/_partial/page/index.ejs
index 5c97f823..65778169 100644
--- a/package/hexo-theme-async/layout/_partial/page/index.ejs
+++ b/package/hexo-theme-async/layout/_partial/page/index.ejs
@@ -3,13 +3,14 @@
<%
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) => { %>