0.1.0 • Published 6 years ago

@mdotasia/gatsby-plugin-tags v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

@mdotasia/gatsby-plugin-tags

This plugin adds tagging support to your blog created with plugin @mdotasia/gatsby-plugin-blog. All you have to do is add an optional tags array to the frontmatter of blog posts. The plugin generates for each tag an array of posts with all blog posts that were tagged with this tag, sorted by date in descending order. This is handed over to a user provided template.

Installation

yarn add @mdotasia/gatsby-plugin-tags

Configuration

Add @mdotasia/gatsby-plugin-tags to plugins. This snippet shows the configuration:

{
  resolve: "@mdotasia/gatsby-plugin-tags",
  options: {
    template: `${__dirname}/src/templates/post.jsx`
  }
}

This plugin has the following options:

OptionDefaultDescription
templateYou need to create your own template for tag pages. Your template receives path and a context object with a posts array and the tag.