@seamlet/astro 1.2.0 → 1.2.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/CHANGELOG.md +4 -0
- package/dist/site.d.ts +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
- `site.staticPaths(content)` is what Astro's `GetStaticPaths` takes: a static site's `[...page]` route may write `satisfies GetStaticPaths` and read its props with `InferGetStaticPropsType`. `StaticPage` and `RenderedPage` became type aliases, and `staticPaths` returns a mutable array.
|
|
6
|
+
|
|
3
7
|
## 1.2.0
|
|
4
8
|
|
|
5
9
|
- `productFields()`: the fields of a product of a catalog, for the record of a collection, with its address, photos, a short and a whole description, the price with a word about it, characteristics as pairs of a name and a value, the switch that hides it and what search engines show.
|
package/dist/site.d.ts
CHANGED
|
@@ -22,10 +22,10 @@ interface SeamletRecordPage {
|
|
|
22
22
|
readonly component: AstroComponentFactory;
|
|
23
23
|
}
|
|
24
24
|
/** What renders a page: its component, and the props to give it. */
|
|
25
|
-
|
|
25
|
+
type RenderedPage = {
|
|
26
26
|
readonly component: AstroComponentFactory;
|
|
27
27
|
readonly props: PageProps;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
type PageProps = {
|
|
30
30
|
readonly content: Content;
|
|
31
31
|
} | {
|
|
@@ -34,12 +34,12 @@ type PageProps = {
|
|
|
34
34
|
readonly index: number;
|
|
35
35
|
};
|
|
36
36
|
/** A page that `getStaticPaths` of a site's `[...page]` route builds. */
|
|
37
|
-
|
|
37
|
+
type StaticPage = {
|
|
38
38
|
readonly params: {
|
|
39
39
|
readonly page: string | undefined;
|
|
40
40
|
};
|
|
41
41
|
readonly props: RenderedPage;
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
|
|
44
44
|
/** The site's content and pages; its id and title come from `seamlet.json`. */
|
|
45
45
|
interface SeamletSiteDefinition<F extends Fields> {
|
|
@@ -78,7 +78,7 @@ interface SeamletSite<F extends Fields = Fields> {
|
|
|
78
78
|
*/
|
|
79
79
|
readonly previewPageOf: (rest: string | undefined, content: ContentOf<F>) => RenderedPage | undefined;
|
|
80
80
|
/** Every page of the site with the content, for `getStaticPaths` of a `[...page]` route. */
|
|
81
|
-
readonly staticPaths: (content: ContentOf<F>) =>
|
|
81
|
+
readonly staticPaths: (content: ContentOf<F>) => StaticPage[];
|
|
82
82
|
/** What the CMS published: the site's initial content until the first publication. */
|
|
83
83
|
readonly loadPublishedContent: () => Promise<ContentOf<F>>;
|
|
84
84
|
/** The site's own photo at an address its content gives it, if it has one there. */
|
package/package.json
CHANGED