spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Fix: base class metadata lost for API pages

Open mohiuddin-khan-shiam opened this issue 6 months ago • 0 comments

What was wrong

apiDetails.baseClass in website/pages/[...listPathPage].tsx was hard-coded to null, ignoring the api_base_class and api_base_class_title values provided in page front-matter.
As a result, API reference pages could not render “extends …​” information or generate correct cross-links, hurting usability and discoverability of the docs.

How it’s fixed

The placeholder line was replaced with real logic:

const baseClass = mdx.frontmatter.api_base_class
  ? {
      title: mdx.frontmatter.api_base_class_title ?? mdx.frontmatter.title,
      slug:  mdx.frontmatter.api_base_class,
    }
  : null;

apiDetails.baseClass now receives this object, allowing the UI to show accurate base-class data whenever it’s supplied, while still defaulting to null when it isn’t.

mohiuddin-khan-shiam avatar Jun 29 '25 16:06 mohiuddin-khan-shiam