« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/listTagsByUses.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/listTagsByUses.js')
-rw-r--r--src/content/dependencies/listTagsByUses.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/content/dependencies/listTagsByUses.js b/src/content/dependencies/listTagsByUses.js
index 81b66424..4bc963be 100644
--- a/src/content/dependencies/listTagsByUses.js
+++ b/src/content/dependencies/listTagsByUses.js
@@ -1,5 +1,10 @@
 import {stitchArrays} from '../../util/sugar.js';
-import {filterByCount, sortByCount} from '../../util/wiki-data.js';
+
+import {
+  filterByCount,
+  sortAlphabetically,
+  sortByCount,
+} from '../../util/wiki-data.js';
 
 export default {
   contentDependencies: ['generateListingPage', 'linkArtTag'],
@@ -10,8 +15,14 @@ export default {
   },
 
   query({artTagData}, spec) {
-    const artTags = artTagData.filter(tag => !tag.isContentWarning);
-    const counts = artTags.map(tag => tag.taggedInThings.length);
+    const artTags =
+      sortAlphabetically(
+        artTagData
+          .filter(tag => !tag.isContentWarning));
+
+    const counts =
+      artTags
+        .map(tag => tag.taggedInThings.length);
 
     filterByCount(artTags, counts);
     sortByCount(artTags, counts, {greatestFirst: true});