@dosgato/templating 0.0.75 → 0.0.77

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.
Files changed (2) hide show
  1. package/dist/render.d.ts +23 -0
  2. package/package.json +1 -1
package/dist/render.d.ts CHANGED
@@ -33,6 +33,15 @@ export interface PictureAttributes {
33
33
  widths: PictureResize[];
34
34
  }[];
35
35
  }
36
+ export interface PageForNavigation {
37
+ id: string;
38
+ name: string;
39
+ title: string;
40
+ path: string;
41
+ href: string;
42
+ extra: Record<string, any>;
43
+ children: this[];
44
+ }
36
45
  export interface APIClient {
37
46
  /**
38
47
  * Identify whether we are generating the page for live, preview, or editing
@@ -116,6 +125,20 @@ export interface APIClient {
116
125
  id?: string;
117
126
  path?: string;
118
127
  }) => Promise<PageRecord<PageData>>;
128
+ /**
129
+ * Get a hierarchical tree of pages suitable for generating a navigation
130
+ * UI for your template.
131
+ *
132
+ * Returns the root page. Subpages are inside the `children` property.
133
+ *
134
+ * "extra" is a list of dot-separated paths to page data that you need to help you build
135
+ * your interface. For example, ['hideInNav'] would fill page.extra with { hideInNav: true }.
136
+ */
137
+ getNavigation: ({ depth, extra, absolute }: {
138
+ depth?: number;
139
+ extra?: string[];
140
+ absolute?: boolean;
141
+ }) => Promise<PageForNavigation>;
119
142
  /**
120
143
  * Get data entries by link or folder link
121
144
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {