diff --git a/packages/website/src/components/Navbar.astro b/packages/website/src/components/Navbar.astro index 144362b01..b3b28a27a 100644 --- a/packages/website/src/components/Navbar.astro +++ b/packages/website/src/components/Navbar.astro @@ -140,7 +140,7 @@ const strings = getStrings(locale); (branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH), ); - const selected = Astro.url.pathname.includes(`/tools/${tool.id}`); + const selected = Astro.url.pathname.includes(`/${tool.id}`); const toolStrings = strings.website.tools[ (tool.stringsId ?? @@ -157,7 +157,7 @@ const strings = getStrings(locale); color="gray" highContrast={selected} size="2" - href={`/tools/${tool.id}`} + href={`/${tool.id}`} underline={selected ? 'always' : 'hover'} > {toolStrings.name} @@ -242,7 +242,7 @@ const strings = getStrings(locale); > { + const match = tagRegex.exec(line); - const path = rawPath.replace(ROOT, ''); + if (match) { + const tag = match[1]; + const descriptionRaw = match[2]; + let discriminator: string | undefined; + let description: string | undefined; - apis.push({ path, content }); + if (tag === '@param') { + const firstWordMatch = firstWordRegex.exec(descriptionRaw)!; + discriminator = firstWordMatch[1]; + description = firstWordMatch[2]; + } else { + description = descriptionRaw; + } + + tags.push({ + tag, + discriminator, + description, + }); + } else { + comment += line; + } + }); + + comment = comment.trim(); + + apis.push({ path, content, comment, tags }); } --- - + { apis.map((api) => ( - - {api.path} + + + + {api.path} + + - {api.content} + + {api.comment} + + + {api.tags.length > 0 && ( + + {api.tags.map(({ tag, description, discriminator }) => ( + + + {tag} + + + {discriminator && ( + + {discriminator} + + )} + + {description && ( + + {description} + + )} + + ))} + + )} )) } diff --git a/packages/website/src/pages/api/gallery/[avatar].webp.ts b/packages/website/src/pages/api/gallery/[avatar].webp.ts index 4325f7c2a..fbd147204 100644 --- a/packages/website/src/pages/api/gallery/[avatar].webp.ts +++ b/packages/website/src/pages/api/gallery/[avatar].webp.ts @@ -15,12 +15,10 @@ export const getStaticPaths = (async () => { const glossary = await fetchGlossary(DEFAULT_LOCALE); /** - * Test comment. - * Test comment. - * Test comment. - * Test comment. - * Test comment. - * Test comment. + * Returns an in-game avatar image. + * + * @param avatar The avatar id. + * @returns A webp image. */ export const GET: APIRoute<{}, { avatar: string }> = async ({ params }) => { const image =