From bce6a52f44b6be8de1d7ed42150d051c25e63fb7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 26 Jul 2023 10:13:46 -0300 Subject: content: generateWikiHomePage (layout besides content) --- src/page/homepage.js | 82 ++++++++++------------------------------------------ src/page/index.js | 2 +- 2 files changed, 17 insertions(+), 67 deletions(-) (limited to 'src/page') diff --git a/src/page/homepage.js b/src/page/homepage.js index d65b2ba..8d06c0b 100644 --- a/src/page/homepage.js +++ b/src/page/homepage.js @@ -13,6 +13,21 @@ import { export const description = `main wiki homepage`; +export function pathsTargetless({wikiData}) { + return [ + { + type: 'page', + path: ['home'], + + contentFunction: { + name: 'generateWikiHomePage', + args: [wikiData.homepageLayout], + }, + }, + ]; +} + +/* export function writeTargetless({wikiData}) { const {newsData, homepageLayout, wikiInfo} = wikiData; @@ -140,74 +155,9 @@ export function writeTargetless({wikiData}) { ]))), ], }, - - sidebarLeft: { - collapse: false, - wide: true, - stickyMode: 'none', - - multiple: [ - homepageLayout.sidebarContent && - transformMultiline(homepageLayout.sidebarContent, { - thumb: 'medium', - }), - - wikiInfo.enableNews && - [ - html.tag('h1', - language.$('homepage.news.title')), - - ...newsData - .slice(0, 3) - .map((entry, i) => - html.tag('article', - { - class: [ - 'news-entry', - i === 0 && 'first-news-entry', - ], - }, - [ - html.tag('h2', [ - html.tag('time', - language.formatDate(entry.date)), - link.newsEntry(entry), - ]), - - transformMultiline(entry.contentShort, { - thumb: 'medium', - }), - - entry.contentShort !== entry.content && - link.newsEntry(entry, { - text: language.$('homepage.news.entry.viewRest') - }), - ])), - ], - ], - }, - - nav: { - linkContainerClasses: ['nav-links-index'], - links: [ - link.home('', {text: wikiInfo.nameShort, class: 'current', to}), - - ...html.fragment( - homepageLayout.navbarLinks?.map(text => - transformInline(text, { - link: - withEntries(link, entries => - entries.map(([key, fn]) => - [key, bindOpts(fn, { - preferShortName: true, - })])), - }))), - ] - .filter(Boolean) - .map((html) => ({html})), - }, }), }; return [page]; } +*/ diff --git a/src/page/index.js b/src/page/index.js index fd55050..408a7e7 100644 --- a/src/page/index.js +++ b/src/page/index.js @@ -12,7 +12,7 @@ export * as artist from './artist.js'; export * as artistAlias from './artist-alias.js'; // export * as flash from './flash.js'; export * as group from './group.js'; -// export * as homepage from './homepage.js'; +export * as homepage from './homepage.js'; export * as listing from './listing.js'; // export * as news from './news.js'; export * as static from './static.js'; -- cgit 1.3.0-6-gf8a5