@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 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?(): Props[];
11
- getContentType?(): string;
12
- default?: ((props: Props) => string) | ((props: Props) => Promise<string>);
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>;
@@ -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,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;AAErD,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,IAAI,KAAK,EAAE,CAAA;IAC3B,cAAc,CAAC,IAAI,MAAM,CAAA;IACzB,OAAO,CAAC,EACL,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,GAC1B,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;CACtC,CAAA;AAED,wBAAsB,IAAI,CAAC,UAAU,EAAE,MA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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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kaathewise/ssg",
3
3
  "description": "Static site generator with TS and JSX support",
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
5
  "license": "MPL-2.0",
6
6
  "author": "Andrej Kolčin",
7
7
  "type": "module",