« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-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)),