-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore templates marked for in platform page sets
- Loading branch information
Showing
6 changed files
with
185 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* This is a simple template that can be used for tests. | ||
*/ | ||
|
||
import * as React from "react"; | ||
import { | ||
Template, | ||
GetPath, | ||
GetRedirects, | ||
TemplateConfig, | ||
TemplateProps, | ||
TemplateRenderProps, | ||
GetHeadConfig, | ||
HeadConfig, | ||
} from "@yext/pages"; | ||
|
||
/** | ||
* Defines the path that the generated file will live at for production. | ||
* | ||
* NOTE: This currently has no impact on the local dev path. Local dev urls currently | ||
* take on the form: featureName/entityId | ||
*/ | ||
export const getPath: GetPath<TemplateProps> = ({ document }) => { | ||
return `location/${document.id.toString()}`; | ||
}; | ||
|
||
/** | ||
* This allows the user to define a function which will take in their template | ||
* data and procude a HeadConfig object. When the site is generated, the HeadConfig | ||
* will be used to generate the inner contents of the HTML document's <head> tag. | ||
* This can include the title, meta tags, script tags, etc. | ||
*/ | ||
export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = ({ | ||
relativePrefixToRoot, | ||
path, | ||
document, | ||
}): HeadConfig => { | ||
return { | ||
title: document.name, | ||
charset: "UTF-8", | ||
viewport: "width=device-width, initial-scale=1", | ||
tags: [ | ||
{ | ||
type: "meta", | ||
attributes: { | ||
description: "This site was generated by the Yext SSG", | ||
}, | ||
}, | ||
], | ||
}; | ||
}; | ||
|
||
/** | ||
* This is the main template. It can have any name as long as it's the default export. | ||
* The props passed in here are the direct stream document defined by `config`. | ||
*/ | ||
const Location: Template<TemplateRenderProps> = ({ | ||
relativePrefixToRoot, | ||
path, | ||
document, | ||
}) => { | ||
const { | ||
_site, | ||
name, | ||
address, | ||
openTime, | ||
hours, | ||
mainPhone, | ||
geocodedCoordinate, | ||
services, | ||
} = document; | ||
|
||
return <>Hello, World</>; | ||
}; | ||
|
||
export default Location; |