[Gatsby Ghost Starter] How to add new static pages?

I just installed the latest gatsby ghost starter and I notice that the src/pages/index.js has been deleted. I tried adding a new page at src/pages/test.js which should automatically create a new page at localhost/test/ but it looks like something has been broken via the starter-project. Likely get wire up pages from ghost-driven content.

Can anyone assist at how to re-enable being able to drop in pages in src/pages/ and have it link up correctly?

Thanks,
Corey

It is possible to add pages in Gatsby when adding them to /src/pages/. Nevertheless, I did try a test.js page and it didn’t get rendered indeed. I assume it is maybe a reserved word in Gatsby. When adding a differently named page (e.g. contact.js) it works:

import { Layout } from '../components/common'

const Contact = () => (
    <Layout>
        <div className="container">
            <article className="content" style={{ textAlign: `center` }}>
                <h1 className="content-title">Test</h1>
                <section className="content-body">
                    Test page.
                </section>
            </article>
        </div>
    </Layout>
)

export default Contact

Can you give this a try and shout if it still doesn’t work?

2 Likes

@Aileen

@mskian Please don’t crosspost

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.