Skip to content

Commit

Permalink
feat(dev): add slugField to TemplateConfig (#460)
Browse files Browse the repository at this point in the history
Adds a `slugField` field to TemplateConfig and TemplateConfigInternal.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and dsurducan committed Jan 10, 2024
1 parent d193b9a commit 302ec3a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/pages/docs/api/pages.templateconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export interface TemplateConfig
| [name?](./pages.templateconfig.name.md) | | string | _(Optional)_ The name of the template feature. If not defined uses the template filename (without extension) |
| [onUrlChange?](./pages.templateconfig.onurlchange.md) | | string | _(Optional)_ The name of the onUrlChange function to use. |
| [pageUrlField?](./pages.templateconfig.pageurlfield.md) | | string | _(Optional)_ The field to be used as the custom writeback URL for the template |
| [slugField?](./pages.templateconfig.slugfield.md) | | string | _(Optional)_ The field to use as the slug for dynamic dev mode |
| [stream?](./pages.templateconfig.stream.md) | | [Stream](./pages.stream.md) | _(Optional)_ The stream configuration used by the template |
| [streamId?](./pages.templateconfig.streamid.md) | | string | _(Optional)_ The stream that this template uses. If a stream is defined the streamId is not required. |
13 changes: 13 additions & 0 deletions packages/pages/docs/api/pages.templateconfig.slugfield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/pages](./pages.md) &gt; [TemplateConfig](./pages.templateconfig.md) &gt; [slugField](./pages.templateconfig.slugfield.md)

## TemplateConfig.slugField property

The field to use as the slug for dynamic dev mode

**Signature:**

```typescript
slugField?: string;
```
3 changes: 2 additions & 1 deletion packages/pages/etc/pages.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export interface TemplateConfig {
name?: string;
onUrlChange?: string;
pageUrlField?: string;
slugField?: string;
stream?: Stream;
streamId?: string;
}
Expand Down Expand Up @@ -309,7 +310,7 @@ export interface WidgetRenderProps<T = any> extends WidgetProps<T> {

// Warnings were encountered during analysis:
//
// dist/types/src/common/src/template/types.d.ts:163:5 - (ae-forgotten-export) The symbol "ProjectStructureConfig" needs to be exported by the entry point index.d.ts
// dist/types/src/common/src/template/types.d.ts:165:5 - (ae-forgotten-export) The symbol "ProjectStructureConfig" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)
```
2 changes: 2 additions & 0 deletions packages/pages/src/common/src/template/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export interface TemplateConfigInternal {
locales?: string[];
/** The field to be used as the custom writeback URL for the template */
pageUrlField?: string;
/** The field to use as the slug for dynamic dev mode */
slugField?: string;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/pages/src/common/src/template/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export interface TemplateConfig {
onUrlChange?: string;
/** The field to be used as the custom writeback URL for the template */
pageUrlField?: string;
/** The field to use as the slug for dynamic dev mode */
slugField?: string;
}

/**
Expand Down

0 comments on commit 302ec3a

Please sign in to comment.