« get me outta code hell

content, css: use :has() to conditionally clear commentary heading - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateCommentarySection.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-18 16:41:32 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-03-02 08:23:22 -0400
commitae08fc94a062554c479c4ba6c4367d31dd157a4f (patch)
tree4401ac9cbec47caebe4336f61b285362e7d38c30 /src/content/dependencies/generateCommentarySection.js
parent90d484d4ca6525b7184e28f452349e1a3b6e759f (diff)
content, css: use :has() to conditionally clear commentary heading
Diffstat (limited to 'src/content/dependencies/generateCommentarySection.js')
-rw-r--r--src/content/dependencies/generateCommentarySection.js17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/content/dependencies/generateCommentarySection.js b/src/content/dependencies/generateCommentarySection.js
index b5b88372..0be81c3b 100644
--- a/src/content/dependencies/generateCommentarySection.js
+++ b/src/content/dependencies/generateCommentarySection.js
@@ -1,5 +1,3 @@
-import {empty} from '#sugar';
-
 export default {
   contentDependencies: [
     'transformContent',
@@ -18,19 +16,12 @@ export default {
         relation('generateCommentaryEntry', entry)),
   }),
 
-  data: (entries) => ({
-    firstEntryIsDated:
-      (empty(entries)
-        ? null
-        : !!entries[0].date),
-  }),
-
   slots: {
     title: {type: 'html', mutable: false},
     id: {type: 'string', default: 'artist-commentary'},
   },
 
-  generate: (data, relations, slots, {html, language}) =>
+  generate: (relations, slots, {html, language}) =>
     html.tags([
       relations.heading
         .slots({
@@ -39,11 +30,7 @@ export default {
               ? language.$('misc.artistCommentary')
               : slots.title),
 
-          attributes: [
-            {id: slots.id},
-            data.firstEntryIsDated &&
-              {class: 'first-entry-is-dated'},
-          ],
+          attributes: {id: slots.id},
         }),
 
       relations.entries,