Socket
Book a DemoInstallSign in
Socket

@maiertech/gatsby-plugin-tags

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maiertech/gatsby-plugin-tags

This Gatsby plugin encapsulates the logic for programmatically creating tag pages.

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@maiertech/gatsby-plugin-tags

This plugin can be used with a Gatsby project or with a Gatsby theme. It encapsulates the logic for programmatically creating tag pages.

Installation

yarn add @maiertech/gatsby-plugin-tags

Configuration

You can only tag pages of type Mdx. Plugin options:

OptionDefaultDescription
dateFormatMMM D, YYYYDate format for tagged items.
typepostType of Mdx pages for which tag pages are created. Another plugin such as @maiertech/gatsby-plugin-blog creates field type, e.g. post. The path for a tag page is <type>s/<tag>.
templateBring your own template. Template receives path and context, which contains values and tag. values contains all items tagged with tag and sorted chronologically (latest item first).

Add @maiertech/gatsby-plugin-tags to your plugins array in gatsby-node.js:

{
  resolve: "@maiertech/gatsby-plugin-tags",
  options: {
    type: 'post'
    template: 'src/templates/tag.jsx',
  }
}

You can create multiple sets of tag pages for different types. Add one configuration per type. Here is another configuration:

{
  resolve: "@maiertech/gatsby-plugin-tags",
  options: {
    dateFormat: 'D MMM YYYY'
    type: 'video'
    template: 'src/templates/tag.jsx',
  }
}

The frontmatter of each item to be tagged needs to include the following properties:

PropertyTypeDescription
dateYYYY-MM-DDItem date.
tagsarray of stringsItem tags.
titlestringItem title.

Keywords

gatsby

FAQs

Package last updated on 11 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.