From 32ede21ad373affca6a6c5d4c92521e786d65a94 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 23 Jun 2024 13:59:29 -0300 Subject: content: generatePageLayout: nicer attributes for nav links --- src/content/dependencies/generatePageLayout.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js index fd2ebdc7..94827568 100644 --- a/src/content/dependencies/generatePageLayout.js +++ b/src/content/dependencies/generatePageLayout.js @@ -327,28 +327,26 @@ export default { if (cur.html) { content = cur.html; } else { + const attributes = html.attributes(); let title; - let href; switch (cur.auto) { case 'home': title = data.wikiName; - href = to('localized.home'); + attributes.set('href', to('localized.home')); break; case 'current': title = slots.title; - href = ''; + attributes.set('href', ''); break; case null: case undefined: title = cur.title; - href = to(...cur.path); + attributes.set('href', to(...cur.path)); break; } - content = html.tag('a', - {href}, - title); + content = html.tag('a', attributes, title); } const showAsCurrent = -- cgit 1.3.0-6-gf8a5