« get me outta code hell

content: move "quick description" into own fn, try on group page too - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateArtTagGalleryPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-02 19:34:53 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-02 19:34:53 -0300
commit9f9945232c01bd4f3c2afdd59a5fc4f661ed3f68 (patch)
treeba312ea760ee28997c23f1184520bd7befc98d2a /src/content/dependencies/generateArtTagGalleryPage.js
parent835a4b6b069552450565970b6151b822e30575c5 (diff)
content: move "quick description" into own fn, try on group page too
Diffstat (limited to 'src/content/dependencies/generateArtTagGalleryPage.js')
-rw-r--r--src/content/dependencies/generateArtTagGalleryPage.js26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/content/dependencies/generateArtTagGalleryPage.js b/src/content/dependencies/generateArtTagGalleryPage.js
index a60d1a5d..269f1b8a 100644
--- a/src/content/dependencies/generateArtTagGalleryPage.js
+++ b/src/content/dependencies/generateArtTagGalleryPage.js
@@ -5,11 +5,11 @@ export default {
   contentDependencies: [
     'generateCoverGrid',
     'generatePageLayout',
+    'generateQuickDescription',
     'image',
     'linkAlbum',
     'linkArtTag',
     'linkTrack',
-    'transformContent',
   ],
 
   extraDependencies: ['html', 'language', 'wikiData'],
@@ -46,10 +46,8 @@ export default {
     relations.infoPageLink =
       relation('linkArtTag', tag);
 
-    if (tag.descriptionShort) {
-      relations.description =
-        relation('transformContent', tag.descriptionShort);
-    }
+    relations.quickDescription =
+      relation('generateQuickDescription', tag);
 
     if (!empty(tag.directAncestorTags)) {
       relations.ancestorLinks =
@@ -86,7 +84,6 @@ export default {
 
     data.name = tag.name;
     data.color = tag.color;
-    data.hasLongerDescription = tag.descriptionShort !== tag.description;
 
     data.numArtworks = query.allThings.length;
 
@@ -120,21 +117,8 @@ export default {
 
         mainClasses: ['top-index'],
         mainContent: [
-          html.tag('p',
-            {
-              [html.joinChildren]: html.tag('br'),
-              [html.onlyIfContent]: true,
-              class:' quick-info',
-            },
-            [
-              relations.description?.slot('mode', 'inline'),
-              data.hasLongerDescription &&
-                language.$('tagPage.moreInfo', {
-                  link:
-                    relations.infoPageLink
-                      .slot('content', language.$('tagPage.moreInfo.link')),
-                }),
-            ]),
+          relations.quickDescription
+            .slot('infoPageLink', relations.infoPageLink),
 
           html.tag('p', {class: 'quick-info'},
             language.$('tagPage.infoLine', {