amplication / docs

Amplication docs
https://docs.amplication.com
Apache License 2.0
17 stars 62 forks source link

Feature: Sidebar Tags #379

Closed dericksozo closed 1 year ago

dericksozo commented 1 year ago

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:

  1. 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".
  2. You can add a custom sidebar tag to any document by specifying the sidebar_tag in that document's YAML.
  3. 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.
  4. Tags can be styled using the .menu__link-sidebar-tag CSS class.
Screen Shot 2023-09-11 at 11 37 21 PM
yuval-hazaz commented 1 year ago

Following the discussion with @dericksozo, we are closing this PR