@@ -10,15 +10,15 @@ import {
1010 Brand as BrandJson ,
1111 BrandFont ,
1212 BrandLogoExplicitResource ,
13- BrandNamedLogo ,
1413 BrandNamedThemeColor ,
15- BrandStringLightDark ,
1614 BrandTypography ,
1715 BrandTypographyOptionsBase ,
1816 BrandTypographyOptionsHeadings ,
1917} from "../../resources/types/schema-types.ts" ;
2018import { InternalError } from "../lib/error.ts" ;
2119
20+ import { join , relative } from "../../deno_ral/path.ts" ;
21+
2222// we can't programmatically convert typescript types to string arrays,
2323// so we have to define this manually. They should match `BrandNamedThemeColor` in schema-types.ts
2424
@@ -237,14 +237,14 @@ export class Brand {
237237 if ( ! entry ) {
238238 return { path : name } ;
239239 }
240+ const pathPrefix = relative ( this . projectDir , this . brandDir ) ;
240241 if ( typeof entry === "string" ) {
241- return { path : entry } ;
242+ return { path : join ( pathPrefix , entry ) } ;
242243 }
244+ entry . path = join ( pathPrefix , entry . path ) ;
243245 return entry ;
244246 }
245247
246- // the same implementation as getColor except we can also return {light,dark}
247- // assuming for now that with only contains strings, not {light,dark}
248248 getLogo ( name : "small" | "medium" | "large" ) : CanonicalLogoInfo | undefined {
249249 const entry = this . data . logo ?. [ name ] ;
250250 if ( ! entry ) {
0 commit comments