grnet / docusaurus-terminology

Home of Docusaurus Terminology Plugin
BSD 2-Clause "Simplified" License
35 stars 5 forks source link

Tooltips Do Not Respect Frontmatter `slug` #29

Open osterman opened 7 months ago

osterman commented 7 months ago

Using slug in the frontmatter is a nice way to shorten URLs, without needing to put categories at the root of the documentation tree.

We would prefer to keep all glossary terms in the reference/glossary/ folder, but on the web show them as /terms/<something>. We can accomplish this natively in Docusarus by setting the frontmatter like this:

---
id: stack
slug: /terms/stack
...
---

Problem

  1. The tooltip feature seems to render the slug based on the id, not taking into account the slug parameter.
  2. Using the slug in the markdown link, does not trigger tooltip behavior. E.g. [Stack](/terms/stack) generates a working link, but hovering over it will not produce a tooltip. Changing this to [Stack](/reference/glossary/stack) works.

Expected Behavior

If the slug exists, use it. Otherwise, default to the current behavior.