« get me outta code hell

content: generateCommentarySection: clear w/ dated first entry - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-09 15:25:10 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-09 17:53:28 -0300
commit1294dd49f1c48fc39963602885fd7687d1a057d0 (patch)
treeeb5010795521170fc1da3ca5c48cec815a5ffc9b /src/content
parenta5c492ea35aac26f94ac7cf4d9af1ae28132ff74 (diff)
content: generateCommentarySection: clear w/ dated first entry
"Clear float" that is!
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateCommentarySection.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/content/dependencies/generateCommentarySection.js b/src/content/dependencies/generateCommentarySection.js
index c7f6fa6a..39727360 100644
--- a/src/content/dependencies/generateCommentarySection.js
+++ b/src/content/dependencies/generateCommentarySection.js
@@ -16,12 +16,23 @@ export default {
         relation('generateCommentaryEntry', entry)),
   }),
 
-  generate: (relations, {html, language}) =>
+  data: (entries) => ({
+    firstEntryIsDated:
+      (entries[0]
+        ? !!entries[0].date
+        : null),
+  }),
+
+  generate: (data, relations, {html, language}) =>
     html.tags([
       relations.heading
         .slots({
-          attributes: {id: 'artist-commentary'},
           title: language.$('misc.artistCommentary'),
+          attributes: [
+            {id: 'artist-commentary'},
+            data.firstEntryIsDated &&
+              {class: 'first-entry-is-dated'},
+          ],
         }),
 
       relations.entries,