Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pittica/gatsby-plugin-blog
Blog optimization plugin for GatsbyJS.
https://github.com/pittica/gatsby-plugin-blog
blog categories gatsby gatsby-plugin gatsbyjs pittica tags
Last synced: 20 days ago
JSON representation
Blog optimization plugin for GatsbyJS.
- Host: GitHub
- URL: https://github.com/pittica/gatsby-plugin-blog
- Owner: pittica
- License: mit
- Created: 2020-05-16T18:02:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T11:39:04.000Z (over 3 years ago)
- Last Synced: 2024-11-15T04:32:25.690Z (about 2 months ago)
- Topics: blog, categories, gatsby, gatsby-plugin, gatsbyjs, pittica, tags
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@pittica/gatsby-plugin-blog
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pittica/gatsby-plugin-blog
![License](https://img.shields.io/github/license/pittica/gatsby-plugin-blog)
![Version](https://img.shields.io/github/package-json/v/pittica/gatsby-plugin-blog)
![Release](https://img.shields.io/github/v/release/pittica/gatsby-plugin-blog)
![GitHub package.json dependency version (dev dep on branch)](https://img.shields.io/github/package-json/dependency-version/pittica/gatsby-plugin-blog/dev/gatsby)
![GitHub package.json dependency version (dev dep on branch)](https://img.shields.io/github/package-json/dependency-version/pittica/gatsby-plugin-blog/dev/react)## Description
Blog optimization plugin for [GatsbyJS](https://www.gatsbyjs.org/).
## Install
[![npm](https://img.shields.io/npm/v/@pittica/gatsby-plugin-blog)](https://www.npmjs.com/package/@pittica/gatsby-plugin-blog)
```shell
npm install @pittica/gatsby-plugin-blog
```## Usage
The plugin requires **categories** and **tags** fields in each header of markdown files.
## Configuration
Edit your **gatsby-config.js**.
```javascript
module.exports = {
plugins: [
{
resolve: `@pittica/gatsby-plugin-blog`,
options: {
postsPerPage: 15,
templateCategory: "./src/templates/category.js",
templateTag: "./src/templates/tag.js",
templateArticle: "./src/templates/blog-post.js",
templateList: "./src/templates/blog-list.js",
slug: "blog",
regex: "/^\/(blog)\//s",
}
},
],
}
```### Attributes
The plugin has optional attributes.
#### postsPerPage
Sets the posts to display per page.
##### Default Value
`15`#### templateCategory
Sets the path of the template used by categories.
#### templateTag
Sets the path of the template used by tags.
#### templateArticle
Sets the path of the template used by blog posts.
#### templateList
Sets the path of the template used by blog root.
#### regex
Sets the regular expression used to filter the slug of the posts. If not setted, the plugin uses the _slug_ parameter.
#### slug
Sets the slug of the posts.
## Copyright
(c) 2020, [Pittica S.r.l.s.](https://pittica.com).