« get me outta code hell

content: generateWikiHomePage (layout besides content) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-07-26 10:13:46 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-26 10:15:23 -0300
commitbce6a52f44b6be8de1d7ed42150d051c25e63fb7 (patch)
tree3cb4b95fe277c37b3bba540f866ab5a2f02525f1 /src/page
parent40b607ef6f0500d36d1e7541b4229e45c866d5ae (diff)
content: generateWikiHomePage (layout besides content)
Diffstat (limited to 'src/page')
-rw-r--r--src/page/homepage.js82
-rw-r--r--src/page/index.js2
2 files changed, 17 insertions, 67 deletions
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';