« get me outta code hell

Merge pull request #134 from hsmusic/url-path-cleanup - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write/page-template.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-10 20:56:54 -0400
committerGitHub <noreply@github.com>2023-01-10 20:56:54 -0400
commit13c81e08805b1de24119c589872dc594af588dcf (patch)
treef23afc29f3e5da987bb9757d042f827e5fe50eb5 /src/write/page-template.js
parent41d35c9b3c22b20cf3291563d299b9d1f347927d (diff)
parent7f6d21d480e22765f438d5a80227f89c416b770b (diff)
Merge pull request #134 from hsmusic/url-path-cleanup
URL & path utilities cleanup
Diffstat (limited to 'src/write/page-template.js')
-rw-r--r--src/write/page-template.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/write/page-template.js b/src/write/page-template.js
index 88d81c23..6ed9fcf5 100644
--- a/src/write/page-template.js
+++ b/src/write/page-template.js
@@ -1,7 +1,6 @@
 import chroma from 'chroma-js';
 
 import * as html from '../util/html.js';
-import {logWarn} from '../util/cli.js';
 import {getColors} from '../util/colors.js';
 
 import {
@@ -55,11 +54,10 @@ export function generateDocumentHTML(pageInfo, {
   languages,
   localizedPathnames,
   oEmbedJSONHref,
-  pageSubKey,
+  pagePath,
   pathname,
   to,
   transformMultiline,
-  urlArgs,
   wikiData,
 }) {
   const {wikiInfo} = wikiData;
@@ -164,14 +162,13 @@ export function generateDocumentHTML(pageInfo, {
           },
           footer.content),
 
-        getFooterLocalizationLinks(pathname, {
+        getFooterLocalizationLinks({
           defaultLanguage,
           html,
           language,
           languages,
-          pageSubKey,
+          pagePath,
           to,
-          urlArgs,
         }),
       ]);
 
@@ -265,11 +262,6 @@ export function generateDocumentHTML(pageInfo, {
           ? to('localized.home')
           : cur.path
           ? to(...cur.path)
-          : cur.href
-          ? (() => {
-              logWarn`Using legacy href format nav link in ${pathname}`;
-              return cur.href;
-            })()
           : null,
       };
       if (attributes.href === null) {
@@ -450,10 +442,9 @@ export function generateDocumentHTML(pageInfo, {
     {
       lang: language.intlCode,
       'data-language-code': language.code,
-      'data-url-key': 'localized.' + pageSubKey,
+      'data-url-key': 'localized.' + pagePath[0],
       ...Object.fromEntries(
-        urlArgs.map((v, i) => [['data-url-value' + i], v])
-      ),
+        pagePath.slice(1).map((v, i) => [['data-url-value' + i], v])),
       'data-rebase-localized': to('localized.root'),
       'data-rebase-shared': to('shared.root'),
       'data-rebase-media': to('media.root'),