Purpose: The plugin adds visual tags (e.g., "New", "Updated", or any custom tag) next to specific sidebar items based on the metadata in the Markdown files (and also sidebars.js)
This PR takes care of Issue #365.
Here's how it works:
It checks the lastUpdatedDate and createdDate for each .mdx and .md file in the docs directory. If the content was updated within the last 7 days, it's tagged as "Updated". If the content was created within the last 7 days, it's tagged as "New".
You can add a custom sidebar tag to any document by specifying the sidebar_tag in that document's YAML.
You can also add a custom sidebar tag by utilizing sidebar.js's customProps object for each document. If you include a sidebarTag property within customProps that tag rendered beside that sidebar item.
Tags can be styled using the .menu__link-sidebar-tag CSS class.
Purpose: The plugin adds visual tags (e.g., "New", "Updated", or any custom tag) next to specific sidebar items based on the metadata in the Markdown files (and also
sidebars.js
)This PR takes care of Issue #365.
Here's how it works:
lastUpdatedDate
andcreatedDate
for each.mdx
and.md
file in thedocs
directory. If the content was updated within the last 7 days, it's tagged as "Updated". If the content was created within the last 7 days, it's tagged as "New".sidebar_tag
in that document's YAML.sidebar.js
'scustomProps
object for each document. If you include asidebarTag
property withincustomProps
that tag rendered beside that sidebar item..menu__link-sidebar-tag
CSS class.