@dosgato/templating
Advanced tools
Comparing version 0.0.143 to 0.0.144
@@ -95,2 +95,12 @@ import type { ComponentData, DataData, PageData } from './component.js'; | ||
/** | ||
* Extra filters for this template | ||
* | ||
* Use this function to return arbitrary tags for your template. These tags will be indexed | ||
* and may be used later as a search filter. | ||
* | ||
* For example, pages may set a 'shownInNav' tag and this could be passed to the getNavigation | ||
* function during rendering to return a smaller set of pages for navigation. | ||
*/ | ||
getTags?: FulltextGatheringFn<DataType>; | ||
/** | ||
* The available component list in the main content area can get very long, among others. Therefore, each | ||
@@ -97,0 +107,0 @@ * template may set a displayCategory and any templates that share a displayCategory will be grouped together |
@@ -11,3 +11,3 @@ /* eslint-disable @typescript-eslint/no-extraneous-class */ | ||
*/ | ||
class ResourceProvider { | ||
export class ResourceProvider { | ||
static webpath(name) { return this.webpaths.get(name); } | ||
@@ -90,2 +90,1 @@ } | ||
ResourceProvider.webpaths = new Map(); | ||
export { ResourceProvider }; |
@@ -285,2 +285,25 @@ import type { ContextBase, DataRecord, PageData, PageRecord, PageRecordOptionalData } from './component.js'; | ||
absolute?: boolean; | ||
/** | ||
* Set a filter to use while building the navigation tree, to limit the amount of pages | ||
* returned. | ||
* | ||
* For example, if pages have a `hideInNav` property, you could check that here to avoid | ||
* returning pages that are supposed to be hidden. | ||
* | ||
* You could always do this yourself after getting the full results, but it will improve | ||
* performance to do it earlier. | ||
*/ | ||
filter?: (page: PageForNavigation) => boolean | undefined; | ||
/** | ||
* Filter for a specific tag as returned by the template's getTags function in the API | ||
* template definition. | ||
*/ | ||
tagsAny?: string[]; | ||
/** | ||
* Set a maximum number of children to be displayed in the menu per page. | ||
* | ||
* For instance, if you set it to 8, no page returned will have more than 8 children. Page | ||
* order will determine which 8 make the cut. | ||
*/ | ||
maxChildren?: number; | ||
}) => Promise<PageForNavigation[]>; | ||
@@ -287,0 +310,0 @@ /** |
{ | ||
"name": "@dosgato/templating", | ||
"version": "0.0.143", | ||
"version": "0.0.144", | ||
"description": "A library to support building templates for dosgato CMS.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115042
2510