mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-12 17:22:25 +03:00
Fix: base class metadata lost for API pages
What was wrong `apiDetails.baseClass` in [website/pages/[...listPathPage].tsx](cci:7://file:///c:/Users/T2430514/Downloads/spaCy/website/pages/%5B...listPathPage%5D.tsx:0:0-0:0) 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: ```ts 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. Co-Authored-By: S. M. Mohiuddin Khan Shiam <147746955+mohiuddin-khan-shiam@users.noreply.github.com>
This commit is contained in:
parent
41e07772dc
commit
908bfd66f8
|
@ -106,15 +106,18 @@ export const getStaticProps: GetStaticProps<PropsPage, ParsedUrlQuery> = async (
|
|||
: null
|
||||
const section = mdx.frontmatter.section ?? parentFolder
|
||||
const sectionMeta = section ? recordSection[section] ?? null : null
|
||||
const baseClass = null
|
||||
|
||||
// Determine base class details from frontmatter, if provided
|
||||
const baseClass = mdx.frontmatter.api_base_class
|
||||
? {
|
||||
title: mdx.frontmatter.api_base_class_title ?? mdx.frontmatter.title,
|
||||
slug: mdx.frontmatter.api_base_class,
|
||||
}
|
||||
: null
|
||||
|
||||
const apiDetails: ApiDetails = {
|
||||
stringName: mdx.frontmatter.api_string_name ?? null,
|
||||
baseClass: baseClass
|
||||
? {
|
||||
title: mdx.frontmatter.title,
|
||||
slug: mdx.frontmatter.api_base_class,
|
||||
}
|
||||
: null,
|
||||
baseClass,
|
||||
trainable: mdx.frontmatter.api_trainable ?? null,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user