« get me outta code hell

content: generatePageLayout: use real blockwrap for nav links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-04-06 13:32:04 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-06 13:32:04 -0300
commit56a47bb97bee2b1bab8119d9deeb73b7c5b37dc8 (patch)
tree20b103c1ce33c3019946c5e5d9004482a5470952
parent5ab7f1f5d2f8c7f90f60be0dcdd0bcfbc14f4c5b (diff)
content: generatePageLayout: use real blockwrap for nav links
The original purpose of blockwrap is finally restored!!!
-rw-r--r--src/content/dependencies/generatePageLayout.js42
-rw-r--r--src/static/css/site.css2
2 files changed, 19 insertions, 25 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index d667a6f4..8a073624 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -396,30 +396,24 @@ export default {
                     i === slots.navLinks.length - 1);
 
                 return (
-                  html.tag('span', {class: 'nav-link'},
-                    showAsCurrent &&
-                      {class: 'current'},
-
-                    [
-                      html.tag('span', {class: 'nav-link-content'},
-                        // Use inline-block styling on the content span,
-                        // rather than wrapping the whole nav-link in a proper
-                        // blockwrap, so that if the content spans multiple
-                        // lines, it'll kick the accent down beneath it.
-                        i > 0 &&
-                          {class: 'blockwrap'},
-
-                        content),
-
-                      html.tag('span', {class: 'nav-link-accent'},
-                        {[html.noEdgeWhitespace]: true},
-                        {[html.onlyIfContent]: true},
-
-                        language.$('misc.navAccent', {
-                          [language.onlyIfOptions]: ['links'],
-                          links: cur.accent,
-                        })),
-                    ]));
+                  html.metatag('blockwrap',
+                    html.tag('span', {class: 'nav-link'},
+                      showAsCurrent &&
+                        {class: 'current'},
+
+                      [
+                        html.tag('span', {class: 'nav-link-content'},
+                          content),
+
+                        html.tag('span', {class: 'nav-link-accent'},
+                          {[html.noEdgeWhitespace]: true},
+                          {[html.onlyIfContent]: true},
+
+                          language.$('misc.navAccent', {
+                            [language.onlyIfOptions]: ['links'],
+                            links: cur.accent,
+                          })),
+                      ])));
               })),
 
           html.tag('div', {class: 'nav-bottom-row'},
diff --git a/src/static/css/site.css b/src/static/css/site.css
index d3ab28a7..c92c65ad 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -950,7 +950,7 @@ a .normal-content {
   font-weight: 800;
 }
 
-.nav-links-hierarchical .nav-link:not(:first-child)::before {
+.nav-links-hierarchical .nav-link + .blockwrap .nav-link::before {
   content: "\0020/\0020";
 }