From 423ab23914fa7d7942e54b4a6cb430424cf3889c Mon Sep 17 00:00:00 2001 From: YoshinoriN Date: Fri, 12 Oct 2018 14:32:00 +0900 Subject: [PATCH] refactor: sort categories by name on all-categories page (#502) --- layout/all-categories.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/all-categories.ejs b/layout/all-categories.ejs index f9ddbefaa..b0ee99f74 100644 --- a/layout/all-categories.ejs +++ b/layout/all-categories.ejs @@ -40,7 +40,7 @@ function displayCategoriesAndPosts(category) { }); if (childCategories.length > 0) { // recursive iteration on its child categories - childCategories.forEach(function(childCategory) { + childCategories.sort('name', 'asc').forEach(function(childCategory) { // clone parents of current category to its child category childCategory.parents = category.parents.slice(); // add current category to the parent of current child category @@ -80,7 +80,7 @@ function displayCategories(category) { if (childCategories.length > 0) { html += '