Chronoblog / gatsby-theme-chronoblog

⏳ Chronoblog is a Gatsbyjs theme specifically designed to create a personal website. The main idea of ​​Chronoblog is to allow you not only to write a personal blog but also to keep a record of everything important that you have done.
https://chronoblog.now.sh
MIT License
129 stars 26 forks source link

Global Tag Management #33

Open ganevdev opened 4 years ago

ganevdev commented 4 years ago

Create an opportunity for global site tag management. In its raw form, it may look something like this (in gatsby-config.js):

gatsby-config.js in gatsby-theme-chronoblog plugin options

tagsManagement: [{
  tagName: "post", // main name of the tag
  replacement: ["posts", "blog-posts"], // all tags matching those listed in this array will be replaced with the one specified in tagName
  hide: true, // if true, this tag will not be displayed to site visitors, but technically it will continue to exist
  textColor: "white", // any css color for text in a tag
  backgroundColor: "#a7d0e0" // any css color for tag background
}]

Since this is an array with objects, you can list any number of tags here (including if such tags do not yet exist on the site). The most important option is the tagName.

This option allows developers to give tags a style (see this: https://github.com/Chronoblog/gatsby-theme-chronoblog/issues/26)

It will also allow developers to hide any tags from view, but at the same time, technically, they will continue to exist, so that developers can use these hidden tags to, say, filter content. This issue was mentioned here: https://github.com/Chronoblog/gatsby-theme-chronoblog/issues/32

ganevdev commented 4 years ago

It will also allow developers to use emoji in tags, without having to remember which emoji were used, something like this:

tagsManagement: [{
  tagName: "🖊️ post",
  replacement: ["post"]
}]

Each time the post tag is used, it is replaced by 🖊️ post.

gethari commented 4 years ago

Awesome. Exicited for this feature