@canopy-iiif/app 1.10.10 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/build/iiif.js +22 -0
- package/package.json +1 -1
package/lib/build/iiif.js
CHANGED
|
@@ -2088,6 +2088,28 @@ async function buildIiifCollectionPages(CONFIG) {
|
|
|
2088
2088
|
lns.push([`⊘ ${String(id)} → ERR`, "red"]);
|
|
2089
2089
|
continue;
|
|
2090
2090
|
}
|
|
2091
|
+
} else if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*:/.test(String(id || ""))) {
|
|
2092
|
+
// Relative or bare file path (no scheme) — resolve against cwd
|
|
2093
|
+
try {
|
|
2094
|
+
const local = await readJsonFromUri(String(id), {log: false});
|
|
2095
|
+
if (!local) {
|
|
2096
|
+
lns.push([`⊘ ${String(id)} → ERR`, "red"]);
|
|
2097
|
+
continue;
|
|
2098
|
+
}
|
|
2099
|
+
manifest = await upgradeIiifResource(local);
|
|
2100
|
+
const saved = await saveCachedManifest(
|
|
2101
|
+
manifest,
|
|
2102
|
+
String(id),
|
|
2103
|
+
String(it.parent || ""),
|
|
2104
|
+
);
|
|
2105
|
+
manifest = saved || manifest;
|
|
2106
|
+
const cached = await loadCachedManifestById(String(id));
|
|
2107
|
+
if (cached) manifest = cached;
|
|
2108
|
+
lns.push([`↓ ${String(id)} → Cached`, "yellow"]);
|
|
2109
|
+
} catch (_) {
|
|
2110
|
+
lns.push([`⊘ ${String(id)} → ERR`, "red"]);
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2091
2113
|
} else {
|
|
2092
2114
|
lns.push([`⊘ ${String(id)} → SKIP`, "red"]);
|
|
2093
2115
|
continue;
|