« get me outta code hell

don't pass around fullKey where unneeded - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write/build-modes
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-10 19:54:10 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-10 19:54:10 -0400
commitfd59ddd05bdfebf2f9a55a0fa5915485929e7de6 (patch)
treec66b4b8e03fee9cf87ff41ceee1c1763992a0a5e /src/write/build-modes
parente06292fe8e7d789d38ac43fd9eee6816e39e18fe (diff)
don't pass around fullKey where unneeded
Diffstat (limited to 'src/write/build-modes')
-rw-r--r--src/write/build-modes/live-dev-server.js7
-rw-r--r--src/write/build-modes/static-build.js7
2 files changed, 5 insertions, 9 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index a5d9da97..bdd4561e 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -83,17 +83,14 @@ export async function go({
       else if (page.type === 'redirect')
         servePath = page.fromPath;
 
-      const fullKey = 'localized.' + servePath[0];
-      const urlArgs = servePath.slice(1);
-
       return Object.values(languages).map(language => {
         const baseDirectory =
           language === defaultLanguage ? '' : language.code;
 
         const pathname = getPagePathname({
           baseDirectory,
-          fullKey,
-          urlArgs,
+          pageSubKey: servePath[0],
+          urlArgs: servePath.slice(1),
           urls,
         });
 
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index 0e8c4b07..edfb02c2 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -267,7 +267,6 @@ export async function go({
       ...pageWrites.map(page => () => {
         const pageSubKey = page.path[0];
         const urlArgs = page.path.slice(1);
-        const fullKey = 'localized.' + pageSubKey;
 
         const localizedPathnames = getPagePathnameAcrossLanguages({
           defaultLanguage,
@@ -279,7 +278,7 @@ export async function go({
 
         const pathname = getPagePathname({
           baseDirectory,
-          fullKey,
+          pageSubKey,
           urlArgs,
           urls,
         });
@@ -345,7 +344,7 @@ export async function go({
           outputDirectory: path.join(outputPath, getPagePathname({
             baseDirectory,
             device: true,
-            fullKey,
+            pageSubKey,
             urlArgs,
             urls,
           })),
@@ -373,7 +372,7 @@ export async function go({
           outputDirectory: path.join(outputPath, getPagePathname({
             baseDirectory,
             device: true,
-            fullKey: 'localized.' + fromPath[0],
+            pageSubKey: fromPath[0],
             urlArgs: fromPath.slice(1),
             urls,
           })),