diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-01-09 21:07:16 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-01-09 21:07:16 -0400 |
commit | 594e8dd46f9e6cc74c680536a1d820eef27133f0 (patch) | |
tree | b4dfeda6e32dfb09df6d3c6c52cccf88bf824005 /src/write/page-template.js | |
parent | 154c050db72ebf06d4514326c696ab43fb3f8dc8 (diff) |
most essential behavior for live-dev-server
Diffstat (limited to 'src/write/page-template.js')
-rw-r--r-- | src/write/page-template.js | 21 |
1 files changed, 12 insertions, 9 deletions
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'), |