Community Plugin
View plugin on GitHubgatsby-theme-baiyezi-core
Description
Lightweight blog theme based on Gatsby.
Dependencies (optional)
- gatsby-source-filesystem
- gatsby-transformer-remark
How to install
For a new site
If you’re creating a new site and want to use the blog theme, you can use the blog theme starter. This will generate a new site that pre-configures use of the blog theme.
gatsby new my-baiyezi-blog https://github.com/662/gatsby-starter-baiyezi-coreFor an existing site
- Install the theme
npm install gatsby-theme-baiyezi-core- Add the configuration to your gatsby-config.jsfile
// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-theme-baiyezi-core`,
      options: {
        // basePath defaults to `/`
        basePath: `/blog`,
      },
    },
  ],
}- 
Add blog posts to your site by creating mdfiles inside/content/posts.
- 
Run your site using gatsby developand navigate to your blog posts. If you used the above configuration, your URL will behttp://localhost:8000/blog
Usage
Theme options
| Key | Default value | Description | 
|---|---|---|
| basePath | / | Root url for all blog posts | 
Example usage
// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-theme-baiyezi-core`,
      options: {
        // basePath defaults to `/`
        basePath: `/blog`,
      },
    },
  ],
}Blog Post Fields
The following are the defined blog post fields based on the node interface in the schema
BaiyeziPost
| Field | Type | 
|---|---|
| id | String | 
| title | String | 
| body | String | 
| path | String | 
| description | String | 
| draft | Boolean | 
| image | String | 
| tags | Tag[] | 
| category | Category | 
| reading | Reading | 
| date | Date |