Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Gatsby Blog theme with tags and categories

License

NotificationsYou must be signed in to change notification settings

Codebrahma/gatsby-theme-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GatsbyGatsby

Gatsby Theme Blog

🔥 A Gatsby blog theme supporting local filesystem content, MDX and image processing.

The theme provides several built-in features to set the bare-minimum for building a blog including:

  • Content sourcing and transformation from the filesystem via gatsby-source-filesystem
  • MDX support via gatsby-plugin-mdx
  • Image processing via gatsby-plugin-sharp and gatsby-remark-images
  • Auto creation of individual blog post pages
  • Auto creation of tags/category/author pages
  • Blog list page with Pagination - you specify the number of blogs in a page in the Theme Options.

Installation

  npm install @codebrahma/gatsby-theme-blog

🚀 Usage

Theme Options

KeyDefault ValueDescription
basePath"/blog"Root URL to all blog posts
contentPath"posts"Location of blog posts
itemsPerPage7Number of items per page
mdxtrueConfigure gatsby-plugin-mdx (if your website already is using the plugin passfalse to turn this off)

Example Usage

// gatsby-config.jsmodule.exports={plugins:[{resolve:`@codebrahma/gatsby-theme-blog`,options:{contentPath:'content/posts',basePath:'/blogs',itemsPerPage:5}}]}

content/posts directory contains all your Markdown files powering the blog.

  mkdir -p content/posts/hello-world  touch content/posts/hello-world/hello-world.md

💡 A sample post is below:

---title: 'Hello World'date: 2019-10-30featuredpost: falsedescription: Hello World, this is my first post.keywords:- gatsby- is- wonderfullink: /hello-worldcategory:- Gatsbyauthor: Codebrahmaimage: ./image.pngtags:- gatsby- reacttemplateKey: blog-post---Hello World! This is my first post! I'll have great features enabled by default, including: - Syntax highlighting with triple backticks- Responsive images- Responsive iframe embeds- and more!

✨ Additional Configuration:

  • In addition to the theme options you can add your own Layout component to the blogs. Create a filesrc/@codebrahma/gatsby-theme-blog/components/layout.js in your site for Component Shadowing.

A sample layout file:

// src/@codebrahma/gatsby-theme-blog/components/layout.jsimportReactfrom'react'importHeaderfrom'./Header'importFooterfrom'./Footer'constLayout=({ children})=>{return(<div><Header/><main>{children}</main><Footer/></div>)}

🎨 Theming

  • Add your own set of design tokens to create a whole new look for the theme. Take a look at currenttheme file and get creative. Upgrade by creating your owntheme.js file.

  • Example:

// src/@codebrahma/gatsby-theme-blog/components/layout.jsimportReactfrom'react'importthemefrom'./theme'import{ThemeProvider}from'theme-ui'constLayout=({ children})=>{return(<ThemeProvidertheme={theme}><main>{children}</main></ThemeProvider>)}

🤝 Contributing

Contributions, issues and feature requests are welcome.Feel free to checkissues page if you want to contribute.

📝 Licence

This project isMIT licensed.

About

Gatsby Blog theme with tags and categories

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp