@kaathewise/ssg 0.9.0 → 0.9.1
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/dist/render.d.ts +3 -4
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +1 -1
- package/package.json +1 -1
package/dist/render.d.ts
CHANGED
|
@@ -5,11 +5,10 @@ export type Page = {
|
|
|
5
5
|
src: string;
|
|
6
6
|
contentType: string | null;
|
|
7
7
|
};
|
|
8
|
-
export type Props = Record<string, string | string[]>;
|
|
9
8
|
export type ArbitraryModule = {
|
|
10
|
-
getStaticParams?():
|
|
11
|
-
getContentType?(): string;
|
|
12
|
-
default?: ((
|
|
9
|
+
getStaticParams?(): Params[];
|
|
10
|
+
getContentType?(params: Params): string;
|
|
11
|
+
default?: ((params: Params) => string) | ((params: Params) => Promise<string>);
|
|
13
12
|
};
|
|
14
13
|
export declare function load(modulePath: string): Promise<ArbitraryModule>;
|
|
15
14
|
export declare function render(modulePath: string, params: Params, config: Config): Promise<Page>;
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,IAAI,MAAM,EAAE,CAAA;IAC5B,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC,OAAO,CAAC,EACL,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,GAC5B,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;CACxC,CAAA;AAED,wBAAsB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAGvE;AAED,wBAAsB,MAAM,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED,wBAAsB,SAAS,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,EAAE,CAAC,CAgBjB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgB1E"}
|
package/dist/render.js
CHANGED
|
@@ -16,7 +16,7 @@ export async function render(modulePath, params, config) {
|
|
|
16
16
|
const module = await load(modulePath);
|
|
17
17
|
let contentType = null;
|
|
18
18
|
if (module.getContentType) {
|
|
19
|
-
contentType = module.getContentType();
|
|
19
|
+
contentType = module.getContentType(params);
|
|
20
20
|
}
|
|
21
21
|
const def = module.default;
|
|
22
22
|
let src;
|