From 4f2f1abd3d97dcb883866c1fb088df831e0b2829 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 30 Oct 2020 10:39:37 -0300 Subject: don't link to index.htmls anymore there's no need to! it was only for when browsing the files locally, but it's much recommended to use an http server for this anyway thanks to icon svgs apparently only working offline. also this means we are only supporting hosted servers, which gives us room to mess around with local storage for per-browser settings, if that's a thing we want to do. --- upd8.js | 184 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) (limited to 'upd8.js') diff --git a/upd8.js b/upd8.js index 2c64b816..74d6aba4 100644 --- a/upd8.js +++ b/upd8.js @@ -117,10 +117,10 @@ const SITE_ABOUT = fixWS`

Welcome to my fan-made Homestuck music wiki!

Homestuck has always been an incredible creative collaboration, and especially beloved by the community and critical in that collaboration is the webcomic and world's humongous soundtrack, comprising well over 500 tracks by dozens of musicians and artists. This wiki aims to be an interesting and useful resource for anyone interested in that music, as well as an archive for all things related.

Pertaining to the history of this site: it was originally made as a remake of Homestuck's official Bandcamp, which saw its content particularly reduced on 10/25/19. This site aims to be a more reliable resource and reference: track art (conspicuously missing from the Bandcamp) is archived here, solo albums (among other missing albums, like [[album:Squiddles!]]) are all indexed in the one place, and URLs will always stay consistent. And of course, also included are links for listening on Bandcamp and other services.

-

The code for this website is open source (GPL-3.0), and can be explored or forked here. I don't actively keep track of issues or PRs raised there; if you want to get in touch with feature requests or comments on the code, my contact info is here!

+

The code for this website is open source (GPL-3.0), and can be explored or forked here. I don't actively keep track of issues or PRs raised there; if you want to get in touch with feature requests or comments on the code, my contact info is here!

Resource & Author Credits

${flashData.filter(flash => flash.act8r8k).map((act, i) => fixWS` -

${act.act}

+

${act.act}

${getFlashGridHTML({ entries: (flashData @@ -1303,7 +1303,7 @@ async function writeAlbumPage(album) { const trackToListItem = track => fixWS`
  • (${getDurationString(track.duration)}) - ${track.name} + ${track.name} ${track.artists !== album.artists && fixWS` by ${getArtistString(track.artists)} ` || ``} @@ -1363,8 +1363,8 @@ async function writeAlbumPage(album) { }, nav: { links: [ - ['index.html', 'Home'], - [`${C.ALBUM_DIRECTORY}/${album.directory}/index.html`, album.name], + ['./', 'Home'], + [`${C.ALBUM_DIRECTORY}/${album.directory}/`, album.name], [null, generateAlbumNavLinks(album)] ], content: fixWS` @@ -1393,9 +1393,9 @@ async function writeTrackPage(track) { }, nav: { links: [ - ['index.html', 'Home'], - [`${C.ALBUM_DIRECTORY}/${album.directory}/index.html`, album.name], - [`${C.TRACK_DIRECTORY}/${track.direcotry}/index.html`, track.name], + ['./', 'Home'], + [`${C.ALBUM_DIRECTORY}/${album.directory}/`, album.name], + [`${C.TRACK_DIRECTORY}/${track.direcotry}/`, track.name], [null, generateAlbumNavLinks(album, track)] ], content: fixWS` @@ -1440,7 +1440,7 @@ async function writeTrackPage(track) {
      ${tracksReferenced.map(track => fixWS`
    • - ${track.name} + ${track.name} by ${getArtistString(track.artists)}
    • `).join('\n')} @@ -1454,7 +1454,7 @@ async function writeTrackPage(track) {
        ${ttrOfficial.map(track => fixWS`
      • - ${track.name} + ${track.name} by ${getArtistString(track.artists)}
      • `).join('\n')} @@ -1465,7 +1465,7 @@ async function writeTrackPage(track) {
          ${ttrFanon.map(track => fixWS`
        • - ${track.name} + ${track.name} by ${getArtistString(track.artists)}
        • `).join('\n')} @@ -1528,7 +1528,7 @@ async function writeArtistPage(artistName) { return fixWS`
        • ${track.duration && `(${getDurationString(track.duration)})` || ``} - ${track.name} + ${track.name} ${track.artists.includes(artistName) && track.artists.length > 1 && `(with ${getArtistString(track.artists.filter(a => a !== artistName))})` || ``} ${contrib.what && `(${getContributionString(contrib) || 'contributed'})` || ``} ${flashes.length && `
          (Featured in ${joinNoOxford(flashes.map(getFlashLinkHTML))})
          ` || ``} @@ -1538,7 +1538,7 @@ async function writeArtistPage(artistName) { // Shish! const kebab = C.getArtistDirectory(artistName); - const index = `${C.ARTIST_DIRECTORY}/${kebab}/index.html`; + const index = `${C.ARTIST_DIRECTORY}/${kebab}/`; await OLD_writePage([C.ARTIST_DIRECTORY, kebab], artistName, fixWS`
          @@ -1574,7 +1574,7 @@ async function writeArtistPage(artistName) { return fixWS`
        • ${thing.album ? fixWS` - ${thing.name} + ${thing.name} ` : '(cover art)'} ${thing.coverArtists.length > 1 && `(with ${getArtistString(thing.coverArtists.filter(({ who }) => who !== artistName))})`} ${contrib.what && `(${getContributionString(contrib)})`} @@ -1588,7 +1588,7 @@ async function writeArtistPage(artistName) { const contributionString = flash.contributors.filter(({ who }) => who === artistName).map(getContributionString).join(' '); return fixWS`
        • - ${flash.name} + ${flash.name} ${contributionString && `(${contributionString})`} (${getDateString({date: flash.date})})
        • @@ -1602,7 +1602,7 @@ async function writeArtistPage(artistName) { return fixWS`
        • ${thing.album ? fixWS` - ${thing.name} + ${thing.name} ` : '(album commentary)'} ${flashes.length && `
          (Featured in ${joinNoOxford(flashes.map(getFlashLinkHTML))})
          `}
        • @@ -1626,7 +1626,7 @@ function albumChunkedList(tracks, getLI, showDate = true, dateProperty = 'date') if (i === 0 || album !== getAlbum(previous) || (showDate && +thing[dateProperty] !== +previous[dateProperty])) { const heading = fixWS`
          - ${getAlbum(thing).name} + ${getAlbum(thing).name} ${showDate && `(${getDateString({date: thing[dateProperty]})})`}
            @@ -1654,7 +1654,7 @@ function actChunkedList(flashes, getLI, showDate = true, dateProperty = 'date') if (i === 0 || act !== previous.act) { const heading = fixWS`
            - ${flash.act} + ${flash.act}
              `; @@ -1728,7 +1728,7 @@ async function writeFlashPage(flash) { const neeeighm = neighm[1].replace('$$$$', ':'); return fixWS`
            • - ${neeeighm} + ${neeeighm} by ${getArtistString(track.artists)}
            • `; @@ -1750,7 +1750,7 @@ async function writeFlashPage(flash) {
                ${flash.contributors.map(({ who, what }) => fixWS`
              • ${artistNames.includes(who) - ? `${who}` + ? `${who}` : who }${what && ` (${getContributionString({what})})`}
              • `).join('\n')} @@ -1760,7 +1760,7 @@ async function writeFlashPage(flash) { }, sidebar: { content: fixWS` -

                Flashes & Games

                +

                Flashes & Games

                ${flashData.filter(f => f.act8r8k).filter(({ act }) => act.startsWith('Act 1') || @@ -1772,18 +1772,18 @@ async function writeFlashPage(flash) { true ) ).flatMap(({ act, color }) => [ - act.startsWith('Act 1') && `
                Side 1 (Acts 1-5)
                ` - || act.startsWith('Act 6 Act 1') && `
                Side 2 (Acts 6-7)
                ` - || act.startsWith('Hiveswap') && `
                Outside Canon (Misc. Games)
                `, + act.startsWith('Act 1') && `
                Side 1 (Acts 1-5)
                ` + || act.startsWith('Act 6 Act 1') && `
                Side 2 (Acts 6-7)
                ` + || act.startsWith('Hiveswap') && `
                Outside Canon (Misc. Games)
                `, ( flashData.findIndex(f => f.act === act) < act6 ? side === 1 : flashData.findIndex(f => f.act === act) < outsideCanon ? side === 2 : true - ) && `
                ${act}
                `, + ) && `
                ${act}
                `, act === flash.act && fixWS`
                  ${flashData.filter(f => !f.act8r8k && f.act === act).map(f => fixWS` -
                • ${f.name}
                • +
                • ${f.name}
                • `).join('\n')}
                ` @@ -1793,9 +1793,9 @@ async function writeFlashPage(flash) { }, nav: { links: [ - ['index.html', 'Home'], - [`${C.FLASH_DIRECTORY}/index.html`, `Flashes & Games`], - [`${C.FLASH_DIRECTORY}/${kebab}/index.html`, flash.name], + ['./', 'Home'], + [`${C.FLASH_DIRECTORY}/`, `Flashes & Games`], + [`${C.FLASH_DIRECTORY}/${kebab}/`, flash.name], parts.length && [null, parts.join(', ')] ].filter(Boolean), content: fixWS` @@ -1821,14 +1821,14 @@ function writeListingPages() { const getAlbumLI = (album, extraText = '') => fixWS`
              • - ${album.name} + ${album.name} ${extraText}
              • `; const getArtistLI = artistName => fixWS`
              • - ${artistName} + ${artistName} (${C.getArtistNumContributions(artistName, {allTracks, albumData, flashData})} c.)
              • `; @@ -1863,7 +1863,7 @@ function writeListingPages() { .sort((a, b) => b.commentary - a.commentary) .map(({ name, commentary }) => fixWS`
              • - ${name} + ${name} (${commentary} ${commentary === 1 ? 'entry' : 'entries'})
              • `)], @@ -1880,7 +1880,7 @@ function writeListingPages() { .sort((a, b) => b.duration - a.duration) .map(({ name, duration }) => fixWS`
              • - ${name} + ${name} (~${getDurationString(duration)})
              • `)], @@ -1894,22 +1894,22 @@ function writeListingPages() { .reverse() .map(({ name, date }) => fixWS`
              • - ${name} + ${name} (${getDateString({date})})
              • `)], [['tracks', 'by-name'], `Tracks - by Name`, allTracks.slice() .sort(sortByName) .map(track => fixWS` -
              • ${track.name}
              • +
              • ${track.name}
              • `)], [['tracks', 'by-album'], `Tracks - by Album`, fixWS`
                ${albumData.map(album => fixWS` -
                ${album.name}
                +
                ${album.name}
                  ${album.tracks.map(track => fixWS` -
                1. ${track.name}
                2. +
                3. ${track.name}
                4. `).join('\n')}
                `).join('\n')} @@ -1918,14 +1918,14 @@ function writeListingPages() { [['tracks', 'by-date'], `Tracks - by Date`, albumChunkedList( C.sortByDate(allTracks.filter(track => track.album.directory !== C.UNRELEASED_TRACKS_DIRECTORY)), track => fixWS` -
              • ${track.name}
              • +
              • ${track.name}
              • `)], [['tracks', 'by-duration'], `Tracks - by Duration`, C.sortByDate(allTracks.slice()) .filter(track => track.duration > 0) .sort((a, b) => b.duration - a.duration) .map(track => fixWS`
              • - ${track.name} + ${track.name} (${getDurationString(track.duration)})
              • `)], @@ -1937,7 +1937,7 @@ function writeListingPages() { )), track => fixWS`
              • - ${track.name} + ${track.name} (${getDurationString(track.duration)})
              • `, @@ -1948,22 +1948,22 @@ function writeListingPages() { .sort((a, b) => getTracksThatReference(b).length - getTracksThatReference(a).length) .map(track => fixWS`
              • - ${track.name} + ${track.name} (${s(getTracksThatReference(track).length, 'time')} referenced)
              • `)], [['tracks', 'in-flashes', 'by-album'], `Tracks - in Flashes & Games (by Album)`, albumChunkedList( C.sortByDate(allTracks.slice()).filter(track => getFlashesThatFeature(track).length > 0), - track => `
              • ${track.name}
              • `)], + track => `
              • ${track.name}
              • `)], [['tracks', 'in-flashes', 'by-flash'], `Tracks - in Flashes & Games (by First Feature)`, Array.from(new Set(flashData.filter(flash => !flash.act8r8k).flatMap(flash => getTracksFeaturedByFlash(flash)))) .filter(Boolean) - .map(track => `
              • ${track.name}
              • `)], + .map(track => `
              • ${track.name}
              • `)], [['tracks', 'with-lyrics'], `Tracks - with Lyrics`, albumChunkedList( C.sortByDate(allTracks.slice()) .filter(track => track.lyrics), track => fixWS` -
              • ${track.name}
              • +
              • ${track.name}
              • `)] ]; @@ -2007,7 +2007,7 @@ function writeListingPages() { .filter(album => [album, ...album.tracks].some(x => x.commentary)) .map(album => fixWS`
              • - ${album.name} + ${album.name} (${(() => { const things = [album, ...album.tracks]; const cThings = things.filter(x => x.commentary); @@ -2024,14 +2024,14 @@ function writeListingPages() { .map(album => [album, ...album.tracks]) .filter(x => x.some(y => y.commentary)) .map(([ album, ...tracks ]) => fixWS` -

                ${album.name}

                +

                ${album.name}

                ${album.commentary && fixWS`
                ${transformMultiline(album.commentary)}
                ` || ``} ${tracks.filter(t => t.commentary).map(track => fixWS` -

                ${track.name}

                +

                ${track.name}

                ${transformMultiline(track.commentary)}
                @@ -2059,19 +2059,19 @@ function writeListingPages() {
                Miscellaneous:
                ${[ {name: 'Official', albumData: officialAlbumData, code: 'official'}, {name: 'Fandom', albumData: fandomAlbumData, code: 'fandom'} ].map(category => fixWS` -
                ${category.name}: (Random Album, Random Track)
                +
                ${category.name}: (Random Album, Random Track)
                `).join('\n')}
              • @@ -2109,13 +2109,13 @@ function writeListingPage(directoryParts, title, items, listingDescriptors) { function generateHeaderForListings(listingDescriptors, currentDirectoryParts) { return fixWS`

                Listings

                ${generateLinkIndexForListings(listingDescriptors, currentDirectoryParts)} `; } @@ -2136,14 +2136,14 @@ function generateLinkIndexForListings(listingDescriptors, currentDirectoryParts) `; @@ -2154,7 +2154,7 @@ function getContributionString({ what }) { return what ? what.replace(/\[(.*?)\]/g, (match, name) => allTracks.some(track => track.name === name) - ? `${name}` + ? `${name}` : `${name}`) : ''; } @@ -2264,7 +2264,7 @@ function getArtistString(artists, showIcons = false) { return joinNoOxford(artists.map(({ who, what }) => { const { urls = [] } = artistData.find(({ name }) => name === who) || {}; return ( - `${who}` + + `${who}` + (what ? ` (${getContributionString({what})})` : '') + (showIcons && urls.length ? ` (${urls.map(iconifyURL).join(', ')})` : '') ); @@ -2388,7 +2388,7 @@ function chronologyLinks(currentTrack, { next && `Next` ].filter(Boolean); - const heading = `${th(index + 1)} ${headingWord} by ${artist}`; + const heading = `${th(index + 1)} ${headingWord} by ${artist}`; return fixWS`
                @@ -2405,9 +2405,9 @@ function generateAlbumNavLinks(album, currentTrack = null) { const next = currentTrack && album.tracks[index + 1] const [ previousLine, nextLine, randomLine ] = [ - previous && `Previous`, - next && `Next`, - `${currentTrack ? 'Random' : 'Random Track'}` + previous && `Previous`, + next && `Next`, + `${currentTrack ? 'Random' : 'Random Track'}` ]; if (previousLine || nextLine) { @@ -2447,10 +2447,10 @@ function generateAlbumChronologyLinks(album, currentTrack = null) { } function generateSidebarForAlbum(album, currentTrack = null) { - const trackToListItem = track => `
              • ${track.name}
              • `; + const trackToListItem = track => `
              • ${track.name}
              • `; const listTag = getAlbumListTag(album); return fixWS` -

                ${album.name}

                +

                ${album.name}

                ${album.usesGroups ? fixWS`
                ${album.tracks.flatMap((track, i, arr) => [ @@ -2458,7 +2458,7 @@ function generateSidebarForAlbum(album, currentTrack = null) { (i === 0 || track.group !== arr[i - 1].group) && fixWS` ${track.group && fixWS`
                - ${track.group} + ${track.group} ${listTag === 'ol' ? `(${i + 1}–${arr.length - arr.slice().reverse().findIndex(t => t.group === track.group)})` : ``}
                `} @@ -2485,7 +2485,7 @@ function getHrefOfAnythingMan(anythingMan) { ) + '/' + ( flashData.includes(anythingMan) ? getFlashDirectory(anythingMan) : anythingMan.directory - ) + '/index.html'; + ) + '/'; } function getAlbumCover(album) { @@ -2515,7 +2515,7 @@ function getFlashLinkHTML(flash, name = null) { if (!name) { name = flash.name; } - return `${name}`; + return `${name}`; } function rebaseURLs(directory, html) { -- cgit 1.3.0-6-gf8a5