]> Lady’s Gitweb - Beorn/blobdiff - build.js
Fix icon and logo to point to nodes
[Beorn] / build.js
index b6ab4867b51373eaec63c6ef7b5f975018238329..7299dc03874219b5eb42fe6a712445391577a8da 100755 (executable)
--- a/build.js
+++ b/build.js
@@ -467,7 +467,8 @@ const applyMetadata = (node, metadata) => {
           default: {
             // The property describes (potentially rich) text.
             if (value == null) {
           default: {
             // The property describes (potentially rich) text.
             if (value == null) {
-              // The property has no value; skip appending it to the node.
+              // The property has no value; skip appending it to the
+              // node.
               continue;
             } else if (Object(value) instanceof String) {
               // The property has a string value.
               continue;
             } else if (Object(value) instanceof String) {
               // The property has a string value.
@@ -532,13 +533,13 @@ const context = Object.freeze({
   icon: Object.freeze({
     namespace: AWOL,
     localName: "icon",
   icon: Object.freeze({
     namespace: AWOL,
     localName: "icon",
-    type: "literal",
+    type: "node",
   }),
   // link is provided by the build script
   logo: Object.freeze({
     namespace: AWOL,
     localName: "logo",
   }),
   // link is provided by the build script
   logo: Object.freeze({
     namespace: AWOL,
     localName: "logo",
-    type: "literal",
+    type: "node",
   }),
   published: Object.freeze({
     namespace: DC11,
   }),
   published: Object.freeze({
     namespace: DC11,
@@ -801,6 +802,10 @@ const metadataFromDocument = (
       const { [name]: existing } = result;
       const content = (() => {
         switch (type) {
       const { [name]: existing } = result;
       const content = (() => {
         switch (type) {
+          case "node": {
+            // The node points to another node.
+            return node.getAttributeNS(RDF, "resource");
+          }
           case "person": {
             // The node describes a person.
             const base =
           case "person": {
             // The node describes a person.
             const base =
@@ -1019,7 +1024,7 @@ await (async () => { // this is the run script
       isDirectory && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/u.test(date)
     ).sort(({ name: a }, { name: b }) =>
       // Sort the directories.
       isDirectory && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/u.test(date)
     ).sort(({ name: a }, { name: b }) =>
       // Sort the directories.
-      a < b ? -1 : a > b ? 1 : 0
+      a < b ? 1 : a > b ? -1 : 0
     )
   ) {
     // Iterate over each dated directory and process its entries.
     )
   ) {
     // Iterate over each dated directory and process its entries.
@@ -1031,7 +1036,10 @@ await (async () => { // this is the run script
         isDirectory &&
         //deno-lint-ignore no-control-regex
         !/[\x00-\x20\x22#%/<>?\\^\x60{|}\x7F]/u.test(entryName)
         isDirectory &&
         //deno-lint-ignore no-control-regex
         !/[\x00-\x20\x22#%/<>?\\^\x60{|}\x7F]/u.test(entryName)
-      ).sort(({ name: a }, { name: b }) => a < b ? -1 : a > b ? 1 : 0)
+      ).sort(({ name: a }, { name: b }) =>
+        // Sort the directories.
+        a < b ? 1 : a > b ? -1 : 0
+      )
     ) {
       // Iterate over each entry directory and process its contents.
       const entry = document.createElement("entry");
     ) {
       // Iterate over each entry directory and process its contents.
       const entry = document.createElement("entry");
This page took 0.024155 seconds and 4 git commands to generate.