docs: restructure api-reference to allow base path (#7954)

This commit is contained in:
Shahed Nasser
2024-07-04 19:12:02 +03:00
committed by GitHub
parent 94e5feeb3d
commit 92dd855290
16 changed files with 99 additions and 80 deletions

View File

@@ -22,7 +22,7 @@ const Navbar = () => {
() =>
getNavbarItems({
basePath: config.baseUrl,
activePath: pathname,
activePath: basePathUrl(pathname),
version: "v2",
}),
[pathname]
@@ -31,8 +31,8 @@ const Navbar = () => {
return (
<UiNavbar
logo={{
light: "/images/logo-icon.png",
dark: "/images/logo-icon-dark.png",
light: basePathUrl("/images/logo-icon.png"),
dark: basePathUrl("/images/logo-icon-dark.png"),
}}
items={navbarItems}
mobileMenuButton={{

View File

@@ -43,7 +43,7 @@ const TagPaths = ({ tag, className }: TagPathsProps) => {
paths: PathsObject
}>(
!Object.keys(paths).length
? basePathUrl(`/tag?tagName=${tagSlugName}&area=${area}`)
? basePathUrl(`/api/tag?tagName=${tagSlugName}&area=${area}`)
: null,
swrFetcher,
{

View File

@@ -58,7 +58,7 @@ const TagSection = ({ tag }: TagSectionProps) => {
}>(
tag["x-associatedSchema"]
? basePathUrl(
`/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}`
`/api/schema?name=${tag["x-associatedSchema"].$ref}&area=${area}`
)
: null,
swrFetcher,

View File

@@ -36,7 +36,7 @@ const Tags = () => {
const { data } = useSWR<ExpandedDocument>(
loadData && !baseSpecs
? basePathUrl(`/base-specs?area=${area}&expand=${expand}`)
? basePathUrl(`/api/base-specs?area=${area}&expand=${expand}`)
: null,
swrFetcher,
{