From 594e8dd46f9e6cc74c680536a1d820eef27133f0 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 9 Jan 2023 21:07:16 -0400 Subject: most essential behavior for live-dev-server --- src/write/page-template.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/write/page-template.js') diff --git a/src/write/page-template.js b/src/write/page-template.js index efbc5795..88d81c23 100644 --- a/src/write/page-template.js +++ b/src/write/page-template.js @@ -53,11 +53,13 @@ export function generateDocumentHTML(pageInfo, { getThemeString, language, languages, - localizedPaths, - paths, + localizedPathnames, oEmbedJSONHref, + pageSubKey, + pathname, to, transformMultiline, + urlArgs, wikiData, }) { const {wikiInfo} = wikiData; @@ -125,11 +127,11 @@ export function generateDocumentHTML(pageInfo, { : null; const canonical = wikiInfo.canonicalBase - ? wikiInfo.canonicalBase + (paths.pathname === '/' ? '' : paths.pathname) + ? wikiInfo.canonicalBase + (pathname === '/' ? '' : pathname) : ''; const localizedCanonical = wikiInfo.canonicalBase - ? Object.entries(localizedPaths).map(([code, {pathname}]) => ({ + ? Object.entries(localizedPathnames).map(([code, pathname]) => ({ lang: code, href: wikiInfo.canonicalBase + (pathname === '/' ? '' : pathname), })) @@ -162,13 +164,14 @@ export function generateDocumentHTML(pageInfo, { }, footer.content), - getFooterLocalizationLinks(paths.pathname, { + getFooterLocalizationLinks(pathname, { defaultLanguage, html, language, languages, - paths, + pageSubKey, to, + urlArgs, }), ]); @@ -264,7 +267,7 @@ export function generateDocumentHTML(pageInfo, { ? to(...cur.path) : cur.href ? (() => { - logWarn`Using legacy href format nav link in ${paths.pathname}`; + logWarn`Using legacy href format nav link in ${pathname}`; return cur.href; })() : null, @@ -447,9 +450,9 @@ export function generateDocumentHTML(pageInfo, { { lang: language.intlCode, 'data-language-code': language.code, - 'data-url-key': paths.urlPath[0], + 'data-url-key': 'localized.' + pageSubKey, ...Object.fromEntries( - paths.urlPath.slice(1).map((v, i) => [['data-url-value' + i], v]) + urlArgs.map((v, i) => [['data-url-value' + i], v]) ), 'data-rebase-localized': to('localized.root'), 'data-rebase-shared': to('shared.root'), -- cgit 1.3.0-6-gf8a5