]> Lady’s Gitweb - GitWikiWeb/commitdiff
Basic support for subpages
authorLady <redacted>
Wed, 23 Aug 2023 19:15:59 +0000 (15:15 -0400)
committerLady <redacted>
Wed, 23 Aug 2023 19:24:53 +0000 (15:24 -0400)
Practically, this just allows `/` in page names. More advanced
functionality to come at a later time.

build.js

index 3d3a862c3f09af3e5ddc72dc9a89934a4c5263c2..0eb61fd8de30773f9abed8bea7f99eb6cd9d674e 100644 (file)
--- a/build.js
+++ b/build.js
@@ -147,8 +147,8 @@ const logErrorsAndCollectResults = (results) =>
   });
 
 const getReferenceFromPath = (path) =>
-  /Sources\/([A-Z][0-9A-Za-z]*\/[A-Z][0-9A-Za-z]*)\.djot$/u.exec(path)
-    ?.[1]?.replace?.("/", ":");
+  /Sources\/([A-Z][0-9A-Za-z]*(?:\/[A-Z][0-9A-Za-z]*)+)\.djot$/u
+    .exec(path)?.[1]?.replace?.("/", ":"); // only replaces first slash
 
 const listOfInternalLinks = (references, wrapper = ($) => $) => ({
   tag: "bullet_list",
@@ -331,7 +331,7 @@ class GitWikiWebPage {
             e.attributes ??= {};
             const { attributes, reference, destination } = e;
             if (
-              /^(?:[A-Z][0-9A-Za-z]*|[@#])?:(?:[A-Z][0-9A-Za-z]*)?$/u
+              /^(?:[A-Z][0-9A-Za-z]*|[@#])?:(?:[A-Z][0-9A-Za-z]*(?:\/[A-Z][0-9A-Za-z]*)*)?$/u
                 .test(reference ?? "")
             ) {
               const [namespacePrefix, pageName] = splitReference(
This page took 0.023833 seconds and 4 git commands to generate.