From a4e7a01c2781b2e21b797da112692ee77a3acc56 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 9 Dec 2020 17:10:17 -0400 Subject: Hashtag Content & miscellaneous fixes + tweaks --- upd8.js | 60 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 23 deletions(-) (limited to 'upd8.js') diff --git a/upd8.js b/upd8.js index cbf25a8..fcb268b 100644 --- a/upd8.js +++ b/upd8.js @@ -262,7 +262,7 @@ function getMultilineField(lines, name) { }; function transformInline(text) { - return text.replace(/\[\[(album:|artist:|flash:|track:)?(.+?)\]\]/g, (match, category, ref, offset) => { + return text.replace(/\[\[(album:|artist:|flash:|track:|tag:)?(.+?)\]\]/g, (match, category, ref, offset) => { if (category === 'album:') { const album = getLinkedAlbum(ref); if (album) { @@ -308,6 +308,16 @@ function transformInline(text) { console.warn(`\x1b[33mThe linked track ${match} does not exist!\x1b[0m`); return ref; } + } else if (category === 'tag:') { + const tag = tagData.find(tag => tag.directory === ref); + if (tag) { + return fixWS` + ${tag.name} + `; + } else { + console.warn(`\x1b[33mThe linked tag ${match} does not exist!\x1b[0m`); + return ref; + } } else { const track = getLinkedTrack(ref); if (track) { @@ -1277,7 +1287,7 @@ function writeMiscellaneousPages() { classes: ['top-index'], content: fixWS`

Albums - Fandom

- +

More listings!

${getAlbumGridHTML({ details: true, @@ -1299,7 +1309,7 @@ function writeMiscellaneousPages() { classes: ['top-index'], content: fixWS`

Albums - Official

- +

More listings!

${getAlbumGridHTML({ details: true, @@ -1322,8 +1332,8 @@ function writeMiscellaneousPages() { content: fixWS`

Flashes & Games

- -