Skip to content

Commit 5204dd4

Browse files
authored
Merge pull request #230 from janezd/fix-inheritables
Fix storing of inheritables in db and prepending of repo prefixes
2 parents ca430a4 + c9bb748 commit 5204dd4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

ingest/inheritables.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ export type InheritableResources = {
1616
export const getInheritableResources = (prefix: string): InheritableResources => [
1717
...resources
1818
.filter(({file}) => pathExists(prefix, file))
19-
.map(({type}) => ({
19+
.map(({type, db}) => ({
2020
type,
21-
path: prefix
21+
path: prefix,
22+
db: db ?? true
2223
})),
2324
...readPublicDir(prefix)
2425
.map((subdir) => `${prefix}/${subdir}`)

ingest/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const addRelativeDir = ({relativeDir}: {relativeDir: string}) => () => (t
3131
const publisher = relativeDir.split("/")[0];
3232
const pubStart = `/${publisher}/`;
3333
const updatedLink = (url: string) =>
34-
/https?:\/\//.test(url) || url.startsWith(pubStart) ? url
34+
/https?:\/\//.test(url) || url.startsWith(pubStart) || url[0] === "#" ? url
3535
: url.startsWith("//") ? url.slice(1)
3636
: url.startsWith("/") ? `/${publisher}${url}`
3737
: `/${relativeDir}/${url}`;

0 commit comments

Comments
 (0)