File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/webdoc-template-library/src/template-plugins Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as external from "@webdoc/externalize";
33import type { Doc , DocType } from "@webdoc/types" ;
44import fetch from "node-fetch" ;
55import { promises as fs } from "fs" ;
6+ import * as path from "path" ;
67import { isDataType } from "@webdoc/model" ;
78import { templateLogger } from "../Logger" ;
89
@@ -160,7 +161,15 @@ function LinkerPluginShell() {
160161
161162 const manifest = external . read ( contents ) ;
162163 const { registry} = manifest ;
163- const { siteDomain, siteRoot} = manifest . metadata ;
164+ let { siteDomain, siteRoot} = manifest . metadata ;
165+
166+ // Provide fallback if URL
167+ if ( siteDomain === undefined && isURL ) {
168+ const { origin, pathname } = new URL ( uri ) ;
169+
170+ siteDomain = origin ;
171+ siteRoot = path . dirname ( pathname ) ;
172+ }
164173
165174 if ( ! siteDomain ) {
166175 throw new Error ( "Imported documented interfaces must have a siteDomain!" ) ;
You can’t perform that action at this time.
0 commit comments