Skip to content

Commit f342924

Browse files
try reversing slash direction for typst on windows
1 parent dd040ea commit f342924

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/core/brand/brand.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,21 @@ export class Brand {
232232
return fonts ?? [];
233233
}
234234

235+
// does typst want forward-slash paths?
236+
relativePath(path: string): string {
237+
const pathPrefix = relative(this.projectDir, this.brandDir);
238+
return join(pathPrefix, path).replace("\\", "/");
239+
}
240+
235241
getLogoResource(name: string): BrandLogoExplicitResource {
236242
const entry = this.data.logo?.images?.[name];
237243
if (!entry) {
238244
return { path: name };
239245
}
240-
const pathPrefix = relative(this.projectDir, this.brandDir);
241246
if (typeof entry === "string") {
242-
return { path: join(pathPrefix, entry) };
247+
return { path: this.relativePath(entry) };
243248
}
244-
entry.path = join(pathPrefix, entry.path);
249+
entry.path = this.relativePath(entry.path);
245250
return entry;
246251
}
247252

0 commit comments

Comments
 (0)