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/build-modes/static-build.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/write/build-modes/static-build.js') diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js index b3700c43..1544a122 100644 --- a/src/write/build-modes/static-build.js +++ b/src/write/build-modes/static-build.js @@ -16,7 +16,6 @@ import * as pageSpecs from '../../page/index.js'; import link from '../../util/link.js'; import {empty, queue, withEntries} from '../../util/sugar.js'; -import {getPagePaths, getURLsFrom} from '../../util/urls.js'; import { logError, @@ -26,6 +25,13 @@ import { progressPromiseAll, } from '../../util/cli.js'; +import { + getPagePathname, + getPagePaths, + getPageSubdirectoryPrefix, + getURLsFrom, +} from '../../util/urls.js'; + const pageFlags = Object.keys(pageSpecs); export function getCLIOptions() { @@ -263,20 +269,18 @@ export async function go({ const pageSubKey = path[0]; const urlArgs = path.slice(1); - const localizedPaths = withEntries(languages, entries => entries + const localizedPathnames = withEntries(languages, entries => entries .filter(([key, language]) => key !== 'default' && !language.hidden) .map(([_key, language]) => [ language.code, - getPagePaths({ - outputPath, - urls, - + getPagePathname({ baseDirectory: (language === defaultLanguage ? '' : language.code), fullKey: 'localized.' + pageSubKey, urlArgs, + urls, }), ])); @@ -293,7 +297,9 @@ export async function go({ urls, baseDirectory, pageSubKey, - paths, + subdirectoryPrefix: getPageSubdirectoryPrefix({ + urlArgs: page.path.slice(1), + }), }); const absoluteTo = (targetFullKey, ...args) => { @@ -320,8 +326,6 @@ export async function go({ const pageInfo = page({ ...bound, - language, - absoluteTo, relativeTo: to, to, @@ -350,7 +354,7 @@ export async function go({ getThemeString: bound.getThemeString, language, languages, - localizedPaths, + localizedPathnames, oEmbedJSONHref, paths, to, @@ -382,7 +386,9 @@ export async function go({ urls, baseDirectory, pageSubKey: fromPath[0], - paths: from, + subdirectoryPrefix: getPageSubdirectoryPrefix({ + urlArgs: fromPath.slice(1), + }), }); const target = to('localized.' + toPath[0], ...toPath.slice(1)); -- cgit 1.3.0-6-gf8a5