fabien0102 / gatsby-starter

Gatsby 2.0 starter with typescript and many cools dev tools
386 stars 99 forks source link

Is `src/templates/blog-page.tsx` a redundant file? #67

Closed ryanblakeley closed 6 years ago

ryanblakeley commented 6 years ago

I'm new to gatsby and there's a lot going on that I'm trying to understand. When I look at the file src/templates/blog-page.tsx and grep the project to see where that file gets used, it doesn't make any sense to me. Is that file getting used anywhere? I only see it getting used in test/__snapshots__/gatsby-node.test.js.snap.

fabien0102 commented 6 years ago

Just here, gatsby read the content from /data (the graphql query) and create pages from the query result (that look like this -> https://github.com/fabien0102/gatsby-starter/blob/master/test/gatsby-node.test.js#L76) using the template into createPage (method provide by the frameworks to inject some page)

But I must admit that this part can be a little bit magic 😄 (it's also the interesting part of gatsby)

ryanblakeley commented 6 years ago

@fabien0102 thank you for clarifying that!