]> Lady’s Gitweb - Beorn/commitdiff
Freeze the context; make it available to hooks
authorLady <redacted>
Wed, 3 May 2023 01:48:04 +0000 (18:48 -0700)
committerLady <redacted>
Wed, 3 May 2023 01:48:04 +0000 (18:48 -0700)
build.js

index 4c26518b85d4a2597126c582d50d305fd4ccd38c..aaa13ed814f2b3f5fcca481e66103f0b52e3d33e 100755 (executable)
--- a/build.js
+++ b/build.js
@@ -511,31 +511,63 @@ const basePath = `./${Deno.args[0] ?? ""}`;
  *
  * - "literal": This is a plaintext field.
  */
-const context = {
-  author: { namespace: DC11, localName: "creator", type: "person" },
+const context = Object.freeze({
+  author: Object.freeze({
+    namespace: DC11,
+    localName: "creator",
+    type: "person",
+  }),
   // category is not supported at this time
-  content: { namespace: SIOC, localName: "content", type: "text" },
-  contributor: {
+  content: Object.freeze({
+    namespace: SIOC,
+    localName: "content",
+    type: "text",
+  }),
+  contributor: Object.freeze({
     namespace: DC11,
     localName: "contributor",
     type: "person",
-  },
+  }),
   // generator is provided by the build script
-  icon: { namespace: AWOL, localName: "icon", type: "literal" },
+  icon: Object.freeze({
+    namespace: AWOL,
+    localName: "icon",
+    type: "literal",
+  }),
   // link is provided by the build script
-  logo: { namespace: AWOL, localName: "logo", type: "literal" },
-  published: {
+  logo: Object.freeze({
+    namespace: AWOL,
+    localName: "logo",
+    type: "literal",
+  }),
+  published: Object.freeze({
     namespace: DC11,
     localName: "date",
     type: "literal",
-  },
-  rights: { namespace: DC11, localName: "rights", type: "text" },
+  }),
+  rights: Object.freeze({
+    namespace: DC11,
+    localName: "rights",
+    type: "text",
+  }),
   // source is not supported at this time
-  subtitle: { namespace: RDFS, localName: "label", type: "text" },
-  summary: { namespace: DC11, localName: "abstract", type: "text" },
-  title: { namespace: DC11, localName: "title", type: "text" },
+  subtitle: Object.freeze({
+    namespace: RDFS,
+    localName: "label",
+    type: "text",
+  }),
+  summary: Object.freeze({
+    namespace: DC11,
+    localName: "abstract",
+    type: "text",
+  }),
+  title: Object.freeze({
+    namespace: DC11,
+    localName: "title",
+    type: "text",
+  }),
   // updated is provided by the build script
-};
+});
 
 const {
   /**
@@ -929,6 +961,7 @@ const validateMetadata = (metadata, type) => {
   globalThis.Lemon = Lemon;
   globalThis.Bjørn = {
     addContent,
+    context,
     getLanguage,
     setLanguage,
   };
This page took 0.024085 seconds and 4 git commands to generate.