From 8aa973e5b4c22b34dfa6256f716ff872d8dad042 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 14 Dec 2020 18:02:39 -0400 Subject: miscellaneous Generalized It code cleanup --- upd8.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/upd8.js b/upd8.js index f1f254f..86aeb53 100644 --- a/upd8.js +++ b/upd8.js @@ -108,6 +108,8 @@ const C = require('./common/common'); const SITE_CANONICAL_BASE = 'https://hsmusic.wiki/'; const SITE_TITLE = 'Homestuck Music Wiki'; const SITE_SHORT_TITLE = 'HSMusic'; +const SITE_DESCRIPTION = `Expansive resource for anyone interested in fan-made and official Homestuck music alike; an archive for all things related.`; + const SITE_VERSION = 'launch of hsmusic.wiki'; const SITE_RELEASE = '12 December 2020'; @@ -700,7 +702,9 @@ async function processFlashDataFile(file) { act = getBasicField(section, 'ACT'); color = getBasicField(section, 'FG'); const anchor = getBasicField(section, 'Anchor'); - return {act8r8k: true, act, color, anchor}; + const jump = getBasicField(section, 'Jump'); + const jumpColor = getBasicField(section, 'Jump Color') || color; + return {act8r8k: true, act, color, anchor, jump, jumpColor}; } const name = getBasicField(section, 'Flash'); @@ -1206,7 +1210,7 @@ function writeMiscellaneousPages() { writePage([], { title: SITE_TITLE, meta: { - description: "Expansive resource for anyone interested in fan-made and official Homestuck music alike; an archive for all things related." + description: SITE_DESCRIPTION }, main: { classes: ['top-index'], @@ -1339,14 +1343,8 @@ function writeMiscellaneousPages() {

Jump to:

@@ -1975,12 +1973,7 @@ async function writeFlashPage(flash) { [ flash.page && getFlashLink(flash), ...flash.urls - ].map(url => `${fancifyURL(url)}` + ( - url.includes('homestuck.com') ? ` (${isNaN(Number(flash.page)) ? 'secret page' : `page ${flash.page}`})` : - url.includes('bgreco.net') ? ` (HQ audio)` : - url.includes('youtu') ? ` (on any device)` : - '' - ) + ``), 'or')}.

` || ``} + ].map(url => fancifyFlashURL(url, flash)), 'or')}.

` || ``} ${flash.contributors.textContent && fixWS`

Contributors:
${transformInline(flash.contributors.textContent)}

`} @@ -2772,6 +2765,15 @@ function fancifyURL(url, {album = false} = {}) { }`; } +function fancifyFlashURL(url, flash) { + return `${fancifyURL(url)}` + ( + url.includes('homestuck.com') ? ` (${isNaN(Number(flash.page)) ? 'secret page' : `page ${flash.page}`})` : + url.includes('bgreco.net') ? ` (HQ audio)` : + url.includes('youtu') ? ` (on any device)` : + '' + ) + ``; +} + function iconifyURL(url) { const [ id, msg ] = ( url.includes('bandcamp.com') ? ['bandcamp', 'Bandcamp'] : -- cgit 1.3.0-6-gf8a5