threshold-network / website

1 stars 10 forks source link

Fetch home page data from cms #20

Closed r-czajkowski closed 2 years ago

r-czajkowski commented 2 years ago

Depends on: #17

Fetching home page data from the cms.

georgeweiler commented 2 years ago

@r-czajkowski I think this will work for us 👍 good job. Looks like we have the text content in /src/pages/index.md. Does this automatically map to the HomePageTemplate? How do you expect to organize the markdown files when more pages are added?

r-czajkowski commented 2 years ago

@r-czajkowski I think this will work for us 👍 good job. Looks like we have the text content in /src/pages/index.md. Does this automatically map to the HomePageTemplate? How do you expect to organize the markdown files when more pages are added?

Here is the magic https://github.com/threshold-network/splash-page/blob/gatsby/gatsby-node.ts#L42-L52. In the cms config we need to add a special hidden field: template.

So to add a new page you have to:

If your md file is eg. faq then the page will be available under localhost:8000/faq.