diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-07 16:01:01 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-07 20:28:00 -0300 |
commit | e7a026a9b5ccce1ccf11c37c4dcd7fbce89b05cf (patch) | |
tree | f4bba0d02652a561b2ce047f8b43dec18cdcfcdd /src/content/dependencies/generateFlashInfoPage.js | |
parent | 131378833ac493d009ebe2f85af7e955deba0530 (diff) |
content: many onlyIfContent, onlyIfSiblings, onlyIfOptions uses
Diffstat (limited to 'src/content/dependencies/generateFlashInfoPage.js')
-rw-r--r-- | src/content/dependencies/generateFlashInfoPage.js | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/content/dependencies/generateFlashInfoPage.js b/src/content/dependencies/generateFlashInfoPage.js index 05964936..fa30c6a2 100644 --- a/src/content/dependencies/generateFlashInfoPage.js +++ b/src/content/dependencies/generateFlashInfoPage.js @@ -19,16 +19,14 @@ export default { query(flash) { const query = {}; - if (flash.page || !empty(flash.urls)) { - query.urls = []; + query.urls = []; - if (flash.page) { - query.urls.push(`https://homestuck.com/story/${flash.page}`); - } + if (flash.page) { + query.urls.push(`https://homestuck.com/story/${flash.page}`); + } - if (!empty(flash.urls)) { - query.urls.push(...flash.urls); - } + if (!empty(flash.urls)) { + query.urls.push(...flash.urls); } return query; @@ -44,10 +42,9 @@ export default { relations.sidebar = relation('generateFlashActSidebar', flash.act, flash); - if (query.urls) { - relations.externalLinks = - query.urls.map(url => relation('linkExternal', url)); - } + relations.externalLinks = + query.urls + .map(url => relation('linkExternal', url)); // TODO: Flashes always have cover art (#175) /* eslint-disable-next-line no-constant-condition */ @@ -135,14 +132,15 @@ export default { date: language.formatDate(data.date), })), - relations.externalLinks && - html.tag('p', - language.$('releaseInfo.playOn', { - links: - language.formatDisjunctionList( - relations.externalLinks - .map(link => link.slot('context', 'flash'))), - })), + html.tag('p', + {[html.onlyIfContent]: true}, + language.$('releaseInfo.playOn', { + [language.onlyIfOptions]: ['links'], + links: + language.formatDisjunctionList( + relations.externalLinks + .map(link => link.slot('context', 'flash'))), + })), html.tag('p', {[html.onlyIfContent]: true}, |