From 5057b24b53f3866cf9f34a6fdfa0d1345c0d8be0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 24 Feb 2022 22:59:04 -0400 Subject: error-free basic full build --- src/page/homepage.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'src/page/homepage.js') diff --git a/src/page/homepage.js b/src/page/homepage.js index e40392a..37dac2c 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -16,7 +16,7 @@ import { // Page exports export function writeTargetless({wikiData}) { - const { newsData, staticPageData, homepageInfo, wikiInfo } = wikiData; + const { newsData, staticPageData, homepageLayout, wikiInfo } = wikiData; const page = { type: 'page', @@ -40,27 +40,24 @@ export function writeTargetless({wikiData}) { classes: ['top-index'], content: fixWS`

${wikiInfo.name}

- ${homepageInfo.rows.map((row, i) => fixWS` + ${homepageLayout.rows?.map((row, i) => fixWS`

${row.name}

${row.type === 'albums' && fixWS`
${getAlbumGridHTML({ entries: ( - row.group === 'new-releases' ? getNewReleases(row.groupCount, {wikiData}) : - row.group === 'new-additions' ? getNewAdditions(row.groupCount, {wikiData}) : - ((find.group(row.group, {wikiData})?.albums || []) + row.sourceGroupByRef === 'new-releases' ? getNewReleases(row.countAlbumsFromGroup, {wikiData}) : + row.sourceGroupByRef === 'new-additions' ? getNewAdditions(row.countAlbumsFromGroup, {wikiData}) : + ((row.sourceGroup?.albums ?? []) .slice() .reverse() - .slice(0, row.groupCount) + .slice(0, row.countAlbumsFromGroup) .map(album => ({item: album}))) - ).concat(row.albums - .map(album => find.album(album, {wikiData})) - .map(album => ({item: album})) - ), + ).concat(row.sourceAlbums.map(album => ({item: album}))), lazy: i > 0 })} - ${row.actions.length && fixWS` + ${row.actions?.length && fixWS`
${row.actions.map(action => transformInline(action) .replace('__GENERATE_NEWS__

', wikiInfo.enableNews ? fixWS`

${strings('homepage.news.title')}

${newsData.slice(0, 3).map((entry, i) => html.tag('article', {class: ['news-entry', i === 0 && 'first-news-entry']}, fixWS`

${link.newsEntry(entry)}

- ${transformMultiline(entry.bodyShort)} - ${entry.bodyShort !== entry.body && link.newsEntry(entry, { + ${transformMultiline(entry.contentShort)} + ${entry.contentShort !== entry.content && link.newsEntry(entry, { text: strings('homepage.news.entry.viewRest') })} `)).join('\n')} @@ -105,15 +102,16 @@ export function writeTargetless({wikiData}) { content: fixWS`

${[ - link.home('', {text: wikiInfo.shortName, class: 'current', to}), + link.home('', {text: wikiInfo.nameShort, class: 'current', to}), wikiInfo.enableListings && link.listingIndex('', {text: strings('listingIndex.title'), to}), wikiInfo.enableNews && link.newsIndex('', {text: strings('newsIndex.title'), to}), wikiInfo.enableFlashesAndGames && link.flashIndex('', {text: strings('flashIndex.title'), to}), - ...staticPageData.filter(page => page.listed).map(page => - link.staticPage(page, {text: page.shortName})) + ...(staticPageData + .filter(page => page.showInNavigationBar) + .map(page => link.staticPage(page, {text: page.nameShort}))) ].filter(Boolean).map(link => `${link}`).join('\n')}

` -- cgit 1.3.0-6-gf8a5