« get me outta code hell

content: generateWikiHomeAlbumsRow + homepage 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 11:23:49 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-26 11:23:49 -0300
commit2d5e22df4b418d96a88afb4589ac326fb77b6e7a (patch)
tree5dcd9ded2e4be484e80e8fc01b9f9617947b5cad /src/page
parentbdb4276ffae1c978ec1d1a6e462faf8c117e20a9 (diff)
content: generateWikiHomeAlbumsRow + homepage content
Diffstat (limited to 'src/page')
-rw-r--r--src/page/homepage.js135
1 files changed, 0 insertions, 135 deletions
diff --git a/src/page/homepage.js b/src/page/homepage.js
index 8d06c0b6..15dcadd1 100644
--- a/src/page/homepage.js
+++ b/src/page/homepage.js
@@ -26,138 +26,3 @@ export function pathsTargetless({wikiData}) {
     },
   ];
 }
-
-/*
-export function writeTargetless({wikiData}) {
-  const {newsData, homepageLayout, wikiInfo} = wikiData;
-
-  const rowData = homepageLayout.rows?.map(row => {
-    const {color, name, type} = row;
-    const entry = {row, color, name, type};
-
-    switch (type) {
-      case 'albums': {
-        entry.displayStyle = row.displayStyle;
-
-        switch (row.sourceGroupByRef) {
-          case 'new-releases':
-            entry.entries = getNewReleases(row.countAlbumsFromGroup, {wikiData});
-            break;
-          case 'new-additions':
-            entry.entries = getNewAdditions(row.countAlbumsFromGroup, {wikiData});
-            break;
-          default:
-            entry.entries = row.sourceGroup
-              ? row.sourceGroup.albums
-                  .slice()
-                  .reverse()
-                  .filter(album => album.isListedOnHomepage)
-                  .slice(0, row.countAlbumsFromGroup)
-                  .map(album => ({item: album}))
-              : [];
-        }
-
-        if (!empty(row.sourceAlbums)) {
-          entry.entries.push(...row.sourceAlbums.map(album => ({item: album})));
-        }
-
-        entry.actionLinks = row.actionLinks ?? [];
-        break;
-      }
-    }
-
-    return entry;
-  });
-
-  const transformActionLinks = (actionLinks, {
-    transformInline,
-  }) =>
-    actionLinks?.map(transformInline)
-      .map(a => a.replace('<a', '<a class="box grid-item"'));
-
-  const page = {
-    type: 'page',
-    path: ['home'],
-    page: ({
-      getAlbumGridHTML,
-      getAlbumCover,
-      getCarouselHTML,
-      getLinkThemeString,
-      html,
-      language,
-      link,
-      to,
-      transformInline,
-      transformMultiline,
-    }) => ({
-      title: wikiInfo.name,
-      showWikiNameInTitle: false,
-
-      meta: {
-        description: wikiInfo.description,
-      },
-
-      main: {
-        classes: ['top-index'],
-        headingMode: 'none',
-
-        content: [
-          html.tag('h1',
-            wikiInfo.name),
-
-          ...html.fragment(
-            rowData.map((entry, i) =>
-              html.tag('section',
-                {
-                  class: 'row',
-                  style: getLinkThemeString(entry.color),
-                },
-                [
-                  html.tag('h2',
-                    entry.name),
-
-                  entry.type === 'albums' &&
-                  entry.displayStyle === 'grid' &&
-                    html.tag('div', {class: 'grid-listing'}, [
-                      ...html.fragment(
-                        getAlbumGridHTML({
-                          entries: entry.entries,
-                          lazy: i > 0,
-                        })),
-
-                      html.tag('div',
-                        {
-                          [html.onlyIfContent]: true,
-                          class: 'grid-actions',
-                        },
-                        transformActionLinks(entry.actionLinks, {
-                          transformInline,
-                        })),
-                    ]),
-
-                  ...html.fragment(
-                    entry.type === 'albums' &&
-                    entry.displayStyle === 'carousel' && [
-                      getCarouselHTML({
-                        items: entry.entries.map(e => e.item),
-                        // Lazy carousels are kinda glitchy, possibly browser-dependant
-                        // lazy: i > 0,
-                        srcFn: getAlbumCover,
-                        linkFn: link.album,
-                      }),
-
-                      entry.actionLinks.length &&
-                        html.tag('div', {class: 'grid-actions'},
-                          transformActionLinks(entry.actionLinks, {
-                            transformInline,
-                          })),
-                    ]),
-                ]))),
-        ],
-      },
-    }),
-  };
-
-  return [page];
-}
-*/