-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby theme blog core #16166
Gatsby theme blog core #16166
Conversation
Thanks for tagging me to this PR! I read your comment on pagination in the other thread. I did this in my themejam submission, the relevant section in Also on that site, I'm transforming the tags array in the frontmatter of a post to an array of objects in graphQL that have this form
errors out, as the fieldValue alone returns a string: |
🎉
I don't like including it by default. I think we should include it as an extension to the data model in some way. I don't know exactly what that looks like yet, but it means we won't have to support n* features in -core if we can pull off "data extension" like this. (personally I don't think pagination is useful, especially for the amount of content the "average" blogger puts out and the purpose of having a page listing. Why make it harder for people to CMD+F through your list of posts? ...but this is a different discussion than the data one above).
I generally avoid nested fields unless it's an additional type. I think in -core we'll solve this problem using a query MyQuery {
allTag {
name
slug
}
} |
Implemented |
👍 to post-query.js |
tags: [String]! | ||
keywords: [String]! | ||
excerpt: String! | ||
body: String! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated body
field
body: String! |
title: String! | ||
body: String! | ||
slug: String! | ||
date: Date! @dateformat(formatString: "DD-MM-YYYY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date: Date! @dateformat(formatString: "DD-MM-YYYY") | |
date: Date! @dateformat |
Or, if we want a default format string, we should have it on MdxBlogPost
as well
|
||
```sh | ||
# create a new Gatsby site using the blog theme starter | ||
gatsby new my-themed-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be referencing gatsby-starter-blog-theme-core
in this README?
gatsby new my-themed-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme | |
gatsby new my-themed-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme-core |
themes/gatsby-starter-blog-theme-core/src/gatsby-theme-blog/gatsby-plugin-theme-ui/colors.js
Outdated
Show resolved
Hide resolved
5109959
to
5e598e7
Compare
Rebased and made all suggested changes. This should be good to go. |
json page output more changes for draft PR base gatsby-theme-blog on gatsby-theme-blog-core remove console fix lint error Create BlogPost interface implementation remove old templates
70c4e57
to
950d8f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
id | ||
excerpt | ||
slug | ||
title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title, date, excerpt aren't used anymore right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏗 😻
Co-Authored-By: John Otander <johnotander@gmail.com>
Basically the same process as: gatsbyjs/gatsby#16166 > A Gatsby theme for creating a blog child theme. It includes all of the data structures you need to get up and running building a blog and includes no additional theming or style opinions. Just for the Emma theme. Which means: You can totally customize the design now, but keep the data structure. So awesome <3 As the Theme UI styling for example happens in `emma`, not `emma-core`.
Basically the same process as: gatsbyjs/gatsby#16166 > A Gatsby theme for creating a blog child theme. It includes all of the data structures you need to get up and running building a blog and includes no additional theming or style opinions. Just for the Emma theme. Which means: You can totally customize the design now, but keep the data structure. So awesome <3 As the Theme UI styling for example happens in `emma`, not `emma-core`.
Basically the same process as: gatsbyjs/gatsby#16166 > A Gatsby theme for creating a blog child theme. It includes all of the data structures you need to get up and running building a blog and includes no additional theming or style opinions. Just for the Emma theme. Which means: You can totally customize the design now, but keep the data structure. So awesome <3 As the Theme UI styling for example happens in `emma`, not `emma-core`.
cc/ @NickyMeuleman
Create gatsby-theme-blog-core
This PR creates a parent theme called gatsby-theme-blog-core which is then used as the parent of gatsby-theme-blog.
gatsby-theme-blog-core
The core theme is a theme meant to encourage re-use of the
BlogPost
core type to build an ecosystem of compatible blog themes on the same base. TheBlogPost
interface itself enables people to create backing implementations from any node type in the Gatsby ecosystem, leading us one step further down the path to supporting any CMS. The core theme implements this approach forMdx
nodes sourced from the included filesystem source. More info on the ability to source from multiple node types here.The theme:
createPage
calls) with templates that renderJSON.stringify(props.data, null, 2)
gatsby-theme-blog
gatsby-theme-blog
becomes effectively a collection of components used to render a Gatsby site. This allows anyone to do the same by shadowing two components from the core theme (src/gatsby-theme-blog-core/components/posts.js
andsrc/gatsby-theme-blog-core/components/post.js
).gatsby-node.js
as it no longer does anything