@dosgato/templating 0.0.77 → 0.0.78
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 +35 -6
- package/package.json +1 -1
package/dist/render.d.ts
CHANGED
|
@@ -129,16 +129,45 @@ export interface APIClient {
|
|
|
129
129
|
* Get a hierarchical tree of pages suitable for generating a navigation
|
|
130
130
|
* UI for your template.
|
|
131
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 }.
|
|
132
|
+
* Returns the root page(s). Subpages are inside the `children` property.
|
|
136
133
|
*/
|
|
137
|
-
getNavigation: ({ depth, extra, absolute }: {
|
|
134
|
+
getNavigation: ({ beneath, depth, extra, absolute }: {
|
|
135
|
+
/**
|
|
136
|
+
* Return pages beneath this path
|
|
137
|
+
*
|
|
138
|
+
* For instance, if you set this to '/site1' you will get back ['/site1/about',
|
|
139
|
+
* '/site1/history', '/site1/history/traditions', ...etc]
|
|
140
|
+
*
|
|
141
|
+
* If you do not set `beneath`, you will get back an array that contains only
|
|
142
|
+
* the root page of the pagetree you are in.
|
|
143
|
+
*/
|
|
144
|
+
beneath?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Return pages to the given depth
|
|
147
|
+
*
|
|
148
|
+
* This is relative to `beneath`, so if `beneath` is '/site1' and `depth` is 0 you
|
|
149
|
+
* will get '/site1/history' and not '/site1/history/traditions'
|
|
150
|
+
*
|
|
151
|
+
* If you do not provide a `beneath`, `depth` 0 will get you the root page, 1 will get
|
|
152
|
+
* you the root page and one level of subpages, etc.
|
|
153
|
+
*/
|
|
138
154
|
depth?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Get extra data from the page data
|
|
157
|
+
*
|
|
158
|
+
* Returning the full page data for a whole tree of pages would be an extreme amount of
|
|
159
|
+
* transfer, but if you need some of the data, you can specify an array of dot-separated
|
|
160
|
+
* paths to retrieve from it.
|
|
161
|
+
*
|
|
162
|
+
* For example, ['hideInNav'] would get you { extra: { hideInNav: tru } } in each returned
|
|
163
|
+
* page record.
|
|
164
|
+
*/
|
|
139
165
|
extra?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* The `href` property in the returned records should be an absolute URL.
|
|
168
|
+
*/
|
|
140
169
|
absolute?: boolean;
|
|
141
|
-
}) => Promise<PageForNavigation>;
|
|
170
|
+
}) => Promise<PageForNavigation[]>;
|
|
142
171
|
/**
|
|
143
172
|
* Get data entries by link or folder link
|
|
144
173
|
*
|