« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write/build-modes/live-dev-server.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/write/build-modes/live-dev-server.js')
-rw-r--r--src/write/build-modes/live-dev-server.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index a8e54247..d481b480 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -17,6 +17,7 @@ import {
   getPagePathname,
   getPageSubdirectoryPrefix,
   getURLsFrom,
+  getURLsFromRoot,
 } from '../../util/urls.js';
 
 import {
@@ -256,20 +257,10 @@ export async function go({
       }),
     });
 
-    const absoluteTo = (targetFullKey, ...args) => {
-      const [groupKey, subKey] = targetFullKey.split('.');
-      const from = urls.from('shared.root');
-      return (
-        '/' +
-        (groupKey === 'localized' && baseDirectory
-          ? from.to(
-              'localizedWithBaseDirectory.' + subKey,
-              baseDirectory,
-              ...args
-            )
-          : from.to(targetFullKey, ...args))
-      );
-    };
+    const absoluteTo = getURLsFromRoot({
+      baseDirectory,
+      urls,
+    });
 
     try {
       const pageSubKey = servePath[0];
@@ -314,7 +305,6 @@ export async function go({
         ...bound,
 
         absoluteTo,
-        relativeTo: to,
         to,
         urls,