Guest User

Untitled

a guest
Jun 21st, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. path: /about/
  2. pageTitle: About Us
  3. metaDescription: Learn more about our team and what we do
  4. ...
  5.  
  6. path: Base
  7. pageTitle: Welcome to our website
  8. metaDescription: We are the leading company of industry x in ...
  9. ...
  10.  
  11. exports.onCreatePage = ({ page, boundActionCreators }) => {
  12. const { createPage, deletePage } = boundActionCreators;
  13. return new Promise(resolve => {
  14. const oldPage = Object.assign({}, page);
  15. deletePage(oldPage);
  16. createPage({
  17. ...oldPage,
  18. context: {
  19. $slug: oldPage.path
  20. }
  21. });
  22. resolve();
  23. });
  24. };
  25.  
  26. query BasePageQuery {
  27. pagesYaml(path: { eq: "Base" }) {
  28. path
  29. pageTitle
  30. metaDescription
  31. ...
  32. }
  33. }
  34.  
  35. query AboutPageQuery($slug: String) {
  36. pagesYaml(path: { eq: $slug }) {
  37. path
  38. pageTitle
  39. metaDescription
  40. ...
  41. }
  42. }
  43.  
  44. query BasePageQuery($slug: String) {
  45. base: pagesYaml(path: { eq: "Base" }) {
  46. path
  47. pageTitle
  48. metaDescription
  49. ...
  50. }
  51. page: pagesYaml(path: { eq: $slug }) {
  52. path
  53. pageTitle
  54. metaDescription
  55. ...
  56. }
  57. }
Add Comment
Please, Sign In to add comment