Skip to content

Commit

Permalink
fix: nulling latestVersionInfo in VersionBanner
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Nov 19, 2024
1 parent c21456f commit c281928
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apify/docusaurus-plugin-typedoc-api",
"version": "4.2.11-3",
"version": "4.2.11-4",
"description": "Docusaurus plugin that provides source code API documentation powered by TypeDoc. ",
"keywords": [
"docusaurus",
Expand Down
40 changes: 21 additions & 19 deletions packages/plugin/src/components/VersionBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,27 @@ export function VersionBanner(): JSX.Element | null {
const latestVersionInfo = docs[latestVersion.label];

return (
<div
className={`${ThemeClassNames.docs.docVersionBanner} alert alert--warning margin-bottom--md`}
role="alert"
>
<div>
{banner === 'unreleased' && <>This is documentation for an unreleased version.</>}
{banner === 'unmaintained' && (
<>
This is documentation for version <b>{version}</b>.
</>
)}{' '}
For the latest API, see version{' '}
<b>
<Link to={latestVersionInfo.id} onClick={handleClick}>
{latestVersionInfo.title}
</Link>
</b>
.
latestVersionInfo ? (
<div
className={`${ThemeClassNames.docs.docVersionBanner} alert alert--warning margin-bottom--md`}
role="alert"
>
<div>
{banner === 'unreleased' && <>This is documentation for an unreleased version.</>}
{banner === 'unmaintained' && (
<>
This is documentation for version <b>{version}</b>.
</>
)}{' '}
For the latest API, see version{' '}
<b>
<Link to={latestVersionInfo.id} onClick={handleClick}>
{latestVersionInfo.title}
</Link>
</b>
.
</div>
</div>
</div>
) : null
);
}
2 changes: 1 addition & 1 deletion packages/plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function typedocApiPlugin(
}

actions.setGlobalData({
isPython: !!(options.python || Object.keys(options.pythonOptions).length > 0),
isPython: !!(options.python || (Object.keys(options.pythonOptions).length > 0)),
} as GlobalData);

const docs: PropVersionDocs = {};
Expand Down

0 comments on commit c281928

Please sign in to comment.