« get me outta code hell

reverse sort things on art tag page - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-06-10 16:56:43 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-06-10 16:56:43 -0300
commit3318ceb4b7685abeaa2daec111ef503feacaefd9 (patch)
tree889bef53b1cc74ba0c0af18954e972296e25818e
parent18455459a991c3da8b32e2c47c4795dc90c6b422 (diff)
reverse sort things on art tag page
-rw-r--r--src/page/tag.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/page/tag.js b/src/page/tag.js
index 610f4665..39bfda60 100644
--- a/src/page/tag.js
+++ b/src/page/tag.js
@@ -18,6 +18,12 @@ export function write(tag, {wikiData}) {
     const { wikiInfo } = wikiData;
     const { things } = tag;
 
+    // Display things featuring this art tag in reverse chronological order,
+    // sticking the most recent additions near the top!
+    const thingsReversed = things.slice().reverse();
+
+    const entries = thingsReversed.map(item => ({item}));
+
     const page = {
         type: 'page',
         path: ['tag', tag.directory],
@@ -42,7 +48,7 @@ export function write(tag, {wikiData}) {
                     })}</p>
                     <div class="grid-listing">
                         ${getGridHTML({
-                            entries: things.map(item => ({item})),
+                            entries,
                             srcFn: thing => (thing.album
                                 ? getTrackCover(thing)
                                 : getAlbumCover(thing)),