« 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--README.md18
-rw-r--r--static/site.css8
-rw-r--r--upd8.js60
3 files changed, 57 insertions, 29 deletions
diff --git a/README.md b/README.md
index f8b3475b..8d587e23 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # HSMusic
 
-HSMusic, short for the *Homestuck Music Wiki*, is a revitalization and reimagining of [earlier][fandom] [projects][nsnd] archiving and celebrating the expansive history of Homestuck official and fan music. Roughly periodic releases of the website are released at [hsmusic.wiki][hsmusic]; all development occurs in this public Git repository, which can be accessed at [notabug.org][notabug] and [ed1.club][ed1club].
+HSMusic, short for the *Homestuck Music Wiki*, is a revitalization and reimagining of [earlier][fandom] [projects][nsnd] archiving and celebrating the expansive history of Homestuck official and fan music. Roughly periodic releases of the website are released at [hsmusic.wiki][hsmusic]; all development occurs in this public Git repository, which can be accessed at [notabug.org][notabug].
 
 ## Project Structure
 
@@ -24,9 +24,23 @@ The majority of the code volume is generated HTML content and supporting utility
 
 In the past, data, HTML, and media files were all interspersed with each other. Yea, even the generated HTML files were included as part of the repository; their diffs, part of every commit. Those were dark times indeed.
 
+## Forking
+
+hsmusic is a relatively generic music wiki software, so you're more than encouraged to create a fork for your own archival or cataloguing purposes! You're encouraged to [drop us a link][feedback] if you do - we'd love to hear from you.
+
+Still, at present moment, a fair bit of the wiki design is baked into the update code itself - any configuration (such as getting rid of the "flashes & games") section will have you digging into the code yourself. In the future, we'd love to make the wiki software more customizable from a forking perspective, but we haven't gotten to it yet. Let us know if this is something you're interested in - we'd love to chat about what additions or changes would be useful in making a more versatile generic music wiki software!
+
+## Pull Requests
+
+As mentioned, part of the focus of the hsmusic.wiki release was to create a more modular and develop-able repository. So, on the curious chance anyone would like to contribute code to the repo, such is certainly capable now!
+
+Still, for larger additions, I'd encourage you to throw an email or contact ([links here][feedback]) before writing all the implementation code: besides code tips which might make your life a bit easier (questions are welcome), I'd also love to discuss feature designs and values while they're still being brainstormed! That way, I don't need to tell you there are fundamental ideas or code details I'd want rebuilt - the last thing I want is anyone putting hours into code which could have been avoided being poured down the drain!
+
+As ever, feedback is always welcome, and may be shared via the usual links. Thank you for checking the repository out!
+
   [fandom]: https://homestuck-and-mspa-music.fandom.com/wiki/Homestuck_and_MSPA_Music_Wiki
   [nsnd]: https://homestuck.net/music/references.html
   [hsmusic]: https://hsmusic.wiki
   [notabug]: https://notabug.org/hsmusic/hsmusic
-  [ed1club]: https://git.ed1.club/florrie/hsmusic
   [fixws]: https://www.npmjs.com/package/fix-whitespace
+  [feedback]: https://hsmusic.wiki/feedback/
diff --git a/static/site.css b/static/site.css
index feff29cb..2892dd87 100644
--- a/static/site.css
+++ b/static/site.css
@@ -509,20 +509,20 @@ h1 {
     margin-bottom: 0.25em;
 }
 
-.quick-links {
+.quick-info {
     text-align: center;
 }
 
-ul.quick-links {
+ul.quick-info {
     list-style: none;
     padding-left: 0;
 }
 
-ul.quick-links li {
+ul.quick-info li {
     display: inline-block;
 }
 
-ul.quick-links li:not(:last-child)::after {
+ul.quick-info li:not(:last-child)::after {
     content: " \00b7 ";
     font-weight: 800;
 }
diff --git a/upd8.js b/upd8.js
index cbf25a80..fcb268bc 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`
+                    <a href="${C.TAG_DIRECTORY}/${tag.directory}/" style="${getThemeString(tag)}">${tag.name}</a>
+                `;
+            } 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`
                     <h1>Albums - Fandom</h1>
-                    <p class="quick-links"><a href="list/">More listings!</a></p>
+                    <p class="quick-info"><a href="list/">More listings!</a></p>
                     <div class="grid-listing">
                         ${getAlbumGridHTML({
                             details: true,
@@ -1299,7 +1309,7 @@ function writeMiscellaneousPages() {
                 classes: ['top-index'],
                 content: fixWS`
                     <h1>Albums - Official</h1>
-                    <p class="quick-links"><a href="list/">More listings!</a></p>
+                    <p class="quick-info"><a href="list/">More listings!</a></p>
                     <div class="grid-listing">
                         ${getAlbumGridHTML({
                             details: true,
@@ -1322,8 +1332,8 @@ function writeMiscellaneousPages() {
                 content: fixWS`
                     <h1>Flashes &amp; Games</h1>
                     <div class="long-content">
-                        <p class="quick-links">Jump to:</p>
-                        <ul class="quick-links">
+                        <p class="quick-info">Jump to:</p>
+                        <ul class="quick-info">
                             ${[
                                 ['a1', 'Side 1 (Acts 1-5)', '#4ac925'],
                                 ['a6a1', 'Side 2 (Acts 6-7)', '#1076a2'],
@@ -2008,7 +2018,7 @@ async function writeFlashPage(flash) {
                 ['./', SITE_SHORT_TITLE],
                 [`${C.FLASH_DIRECTORY}/`, `Flashes &amp; Games`],
                 [`${C.FLASH_DIRECTORY}/${kebab}/`, flash.name],
-                parts.length && [null, parts.join(', ')]
+                parts.length && [null, `(${parts.join(', ')})`]
             ].filter(Boolean),
             content: fixWS`
                 <div>
@@ -2532,6 +2542,7 @@ function writeTagPage(tag) {
             classes: ['top-index'],
             content: fixWS`
                 <h1>${tag.name}</h1>
+                <p class="quick-info">(Appears in ${s(things.length, 'cover art')})</p>
                 <div class="grid-listing">
                     ${getGridHTML({
                         entries: things.map(item => ({item})),
@@ -2779,9 +2790,11 @@ function chronologyLinks(currentTrack, {
     headingWord,
     sourceData = justEverythingMan
 }) {
-    return (
-        Array.from(new Set(filters.flatMap(({ mapProperty, toArtist }) => currentTrack[mapProperty] && currentTrack[mapProperty].map(toArtist))))
-    ).map(artist => {
+    const artists = Array.from(new Set(filters.flatMap(({ mapProperty, toArtist }) => currentTrack[mapProperty] && currentTrack[mapProperty].map(toArtist))));
+    if (artists.length > 8) {
+        return `<div class="chronology">(See artist pages for chronology info!)</div>`;
+    }
+    return artists.map(artist => {
         if (!artistNames.includes(artist)) return '';
 
         const releasedThings = sourceData.filter(thing => {
@@ -3059,19 +3072,6 @@ async function main() {
             ])
         ].map(contribution => contribution.who)
     ]));
-    newsData = await processNewsDataFile(path.join(C.DATA_DIRECTORY, NEWS_DATA_FILE));
-    if (newsData.error) {
-        console.log(`\x1b[31;1m${newsData.error}\x1b[0m`);
-        return;
-    }
-
-    const newsErrors = newsData.filter(obj => obj.error);
-    if (newsErrors.length) {
-        for (const error of newsErrors) {
-            console.log(`\x1b[31;1m${error.error}\x1b[0m`);
-        }
-        return;
-    }
 
     tagData = await processTagDataFile(path.join(C.DATA_DIRECTORY, TAG_DATA_FILE));
     if (tagData.error) {
@@ -3089,6 +3089,20 @@ async function main() {
         }
     }
 
+    newsData = await processNewsDataFile(path.join(C.DATA_DIRECTORY, NEWS_DATA_FILE));
+    if (newsData.error) {
+        console.log(`\x1b[31;1m${newsData.error}\x1b[0m`);
+        return;
+    }
+
+    const newsErrors = newsData.filter(obj => obj.error);
+    if (newsErrors.length) {
+        for (const error of newsErrors) {
+            console.log(`\x1b[31;1m${error.error}\x1b[0m`);
+        }
+        return;
+    }
+
     {
         const tagNames = new Set([...allTracks, ...albumData].flatMap(thing => thing.artTags));
 
@@ -3268,7 +3282,7 @@ async function main() {
     await writeMiscellaneousPages();
     await writeListingPages();
     await writeTagPages();
-    await progressPromiseAll(`Writing album & track pages.`, queue(albumData.map(album => writeIndexAndTrackPagesForAlbum(album)).reduce((a, b) => a.concat(b))));
+    // await progressPromiseAll(`Writing album & track pages.`, queue(albumData.map(album => writeIndexAndTrackPagesForAlbum(album)).reduce((a, b) => a.concat(b))));
     await writeArtistPages();
     await writeFlashPages();