From 473740f69dcbad408b0d84567c2bb2de97e8a4aa Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 2 Aug 2023 21:41:30 -0300 Subject: content: bunch of stub pages --- src/content/dependencies/generateFlashIndexPage.js | 29 +++++++++++++++++ src/content/dependencies/generateFlashInfoPage.js | 38 ++++++++++++++++++++++ .../dependencies/listAllMidiProjectFiles.js | 28 ++++++++++++++++ src/content/dependencies/listAllSheetMusicFiles.js | 28 ++++++++++++++++ src/content/dependencies/listRandomPageLinks.js | 28 ++++++++++++++++ src/listing-spec.js | 19 ++++++++--- src/page/flash.js | 26 +++++++++++++++ src/page/index.js | 2 +- 8 files changed, 193 insertions(+), 5 deletions(-) create mode 100644 src/content/dependencies/generateFlashIndexPage.js create mode 100644 src/content/dependencies/generateFlashInfoPage.js create mode 100644 src/content/dependencies/listAllMidiProjectFiles.js create mode 100644 src/content/dependencies/listAllSheetMusicFiles.js create mode 100644 src/content/dependencies/listRandomPageLinks.js diff --git a/src/content/dependencies/generateFlashIndexPage.js b/src/content/dependencies/generateFlashIndexPage.js new file mode 100644 index 0000000..24f9c86 --- /dev/null +++ b/src/content/dependencies/generateFlashIndexPage.js @@ -0,0 +1,29 @@ +export default { + contentDependencies: ['generatePageLayout'], + extraDependencies: ['html', 'language'], + + relations(relation) { + const relations = {}; + + relations.layout = + relation('generatePageLayout'); + + return relations; + }, + + generate(relations, {html, language}) { + return relations.layout.slots({ + title: language.$('flashIndex.title'), + + mainContent: [ + html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + ], + + navLinkStyle: 'hierarchical', + navLinks: [ + {auto: 'home'}, + {auto: 'current'}, + ], + }); + }, +}; diff --git a/src/content/dependencies/generateFlashInfoPage.js b/src/content/dependencies/generateFlashInfoPage.js new file mode 100644 index 0000000..4316d7c --- /dev/null +++ b/src/content/dependencies/generateFlashInfoPage.js @@ -0,0 +1,38 @@ +export default { + contentDependencies: ['generatePageLayout'], + extraDependencies: ['html', 'language'], + + relations(relation) { + const relations = {}; + + relations.layout = + relation('generatePageLayout'); + + return relations; + }, + + data(flash) { + return { + name: flash.name, + }; + }, + + generate(data, relations, {html, language}) { + return relations.layout.slots({ + title: + language.$('flashPage.title', { + flash: data.name, + }), + + mainContent: [ + html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + ], + + navLinkStyle: 'hierarchical', + navLinks: [ + {auto: 'home'}, + {auto: 'current'}, + ], + }); + }, +}; diff --git a/src/content/dependencies/listAllMidiProjectFiles.js b/src/content/dependencies/listAllMidiProjectFiles.js new file mode 100644 index 0000000..28a925a --- /dev/null +++ b/src/content/dependencies/listAllMidiProjectFiles.js @@ -0,0 +1,28 @@ +export default { + contentDependencies: ['generateListingPage'], + extraDependencies: ['html', 'wikiData'], + + sprawl() { + return {}; + }, + + query(sprawl, spec) { + return { + spec, + }; + }, + + relations(relation, query) { + return { + page: relation('generateListingPage', query.spec), + }; + }, + + generate(relations, {html}) { + return relations.page.slots({ + type: 'custom', + content: + html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + }); + }, +}; diff --git a/src/content/dependencies/listAllSheetMusicFiles.js b/src/content/dependencies/listAllSheetMusicFiles.js new file mode 100644 index 0000000..28a925a --- /dev/null +++ b/src/content/dependencies/listAllSheetMusicFiles.js @@ -0,0 +1,28 @@ +export default { + contentDependencies: ['generateListingPage'], + extraDependencies: ['html', 'wikiData'], + + sprawl() { + return {}; + }, + + query(sprawl, spec) { + return { + spec, + }; + }, + + relations(relation, query) { + return { + page: relation('generateListingPage', query.spec), + }; + }, + + generate(relations, {html}) { + return relations.page.slots({ + type: 'custom', + content: + html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + }); + }, +}; diff --git a/src/content/dependencies/listRandomPageLinks.js b/src/content/dependencies/listRandomPageLinks.js new file mode 100644 index 0000000..28a925a --- /dev/null +++ b/src/content/dependencies/listRandomPageLinks.js @@ -0,0 +1,28 @@ +export default { + contentDependencies: ['generateListingPage'], + extraDependencies: ['html', 'wikiData'], + + sprawl() { + return {}; + }, + + query(sprawl, spec) { + return { + spec, + }; + }, + + relations(relation, query) { + return { + page: relation('generateListingPage', query.spec), + }; + }, + + generate(relations, {html}) { + return relations.page.slots({ + type: 'custom', + content: + html.tag('p', `Alright alright, this is a stub page! Coming soon!`), + }); + }, +}; diff --git a/src/listing-spec.js b/src/listing-spec.js index 9ca7574..8250317 100644 --- a/src/listing-spec.js +++ b/src/listing-spec.js @@ -212,6 +212,7 @@ listingSpec.push({ featureFlag: 'enableArtTagUI', }); +/* function listAdditionalFilesInProperty(property, { directory, stringsKey, @@ -272,24 +273,33 @@ function listAdditionalFilesInProperty(property, { ]), }; } +*/ -listingSpec.push(listAdditionalFilesInProperty('sheetMusicFiles', { +listingSpec.push({ + /* listAdditionalFilesInProperty('sheetMusicFiles') */ directory: 'all-sheet-music-files', stringsKey: 'other.allSheetMusic', + contentFunction: 'listAllSheetMusicFiles', seeAlso: ['tracks/with-sheet-music-files'], -})); + groupUnderOther: true, +}); -listingSpec.push(listAdditionalFilesInProperty('midiProjectFiles', { +listingSpec.push({ + /* listAdditionalFilesInProperty('midiProjectFiles') */ directory: 'all-midi-project-files', stringsKey: 'other.allMidiProjectFiles', + contentFunction: 'listAllMidiProjectFiles', seeAlso: ['tracks/with-midi-project-files'], -})); + groupUnderOther: true, +}); listingSpec.push({ directory: 'random', stringsKey: 'other.randomPages', + contentFunction: 'listRandomPageLinks', groupUnderOther: true, + /* data: ({wikiData: {albumData}}) => [ { name: 'Official', @@ -377,6 +387,7 @@ listingSpec.push({ ]), ]), ]), + */ }); { diff --git a/src/page/flash.js b/src/page/flash.js index 2f5778e..f5d7347 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -13,6 +13,31 @@ export function targets({wikiData}) { return wikiData.flashData; } +export function pathsForTarget(flash) { + return [ + { + type: 'page', + path: ['flash', flash.directory], + + contentFunction: { + name: 'generateFlashInfoPage', + args: [flash], + }, + }, + ]; +} + +export function pathsTargetless() { + return [ + { + type: 'page', + path: ['flashIndex'], + contentFunction: {name: 'generateFlashIndexPage'}, + }, + ]; +} + +/* export function write(flash, {wikiData}) { const page = { type: 'page', @@ -337,3 +362,4 @@ function generateSidebarForFlash(flash, { ], }; } +*/ diff --git a/src/page/index.js b/src/page/index.js index a2cdbbd..e62241d 100644 --- a/src/page/index.js +++ b/src/page/index.js @@ -10,7 +10,7 @@ export * as album from './album.js'; export * as artist from './artist.js'; export * as artistAlias from './artist-alias.js'; -// export * as flash from './flash.js'; +export * as flash from './flash.js'; export * as group from './group.js'; export * as homepage from './homepage.js'; export * as listing from './listing.js'; -- cgit 1.3.0-6-gf8a5