Skip to content

Commit

Permalink
refactor: sort categories by name on all-categories page (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin authored and LouisBarranqueiro committed Oct 12, 2018
1 parent fb5830e commit 423ab23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layout/all-categories.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,7 +80,7 @@ function displayCategories(category) {
if (childCategories.length > 0) {
html += '<ul style="margin-bottom: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
Expand Down

0 comments on commit 423ab23

Please sign in to comment.