Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path: /about/
- pageTitle: About Us
- metaDescription: Learn more about our team and what we do
- ...
- path: Base
- pageTitle: Welcome to our website
- metaDescription: We are the leading company of industry x in ...
- ...
- exports.onCreatePage = ({ page, boundActionCreators }) => {
- const { createPage, deletePage } = boundActionCreators;
- return new Promise(resolve => {
- const oldPage = Object.assign({}, page);
- deletePage(oldPage);
- createPage({
- ...oldPage,
- context: {
- $slug: oldPage.path
- }
- });
- resolve();
- });
- };
- query BasePageQuery {
- pagesYaml(path: { eq: "Base" }) {
- path
- pageTitle
- metaDescription
- ...
- }
- }
- query AboutPageQuery($slug: String) {
- pagesYaml(path: { eq: $slug }) {
- path
- pageTitle
- metaDescription
- ...
- }
- }
- query BasePageQuery($slug: String) {
- base: pagesYaml(path: { eq: "Base" }) {
- path
- pageTitle
- metaDescription
- ...
- }
- page: pagesYaml(path: { eq: $slug }) {
- path
- pageTitle
- metaDescription
- ...
- }
- }
Add Comment
Please, Sign In to add comment