Skip to content

Commit

Permalink
fix: filter out internals
Browse files Browse the repository at this point in the history
+ use name instead of longname for linking
  • Loading branch information
felixroos committed Aug 10, 2023
1 parent 60deb46 commit 37a2ee5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions website/src/components/LeftSidebar/ReferenceSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ let currentPageMatch = currentPage.slice(BASE_URL.length, currentPage.endsWith('
{
docs
.filter(({ tags }) => !tags?.find((t) => t.title === 'noautocomplete'))
.map(({ longname, name }) => {
const link = 'ref/' + longname;
.filter(({ name, description }) => name && !name.startsWith('_') && !!description)
// @ts-ignore
.sort((a, b) => a.name.localeCompare(b.name))
.map(({ name }) => {
const link = 'ref/' + name;
const url = Astro.site?.pathname + link;
return (
<li class="">
Expand Down
6 changes: 3 additions & 3 deletions website/src/pages/ref/[ref].astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { docs } from '../../../../doc.json';
import JsDoc from '../../docs/JsDoc.astro';
export function getStaticPaths() {
return docs.map((doc) => [{ params: { ref: doc.longname } }]);
return docs.map((doc) => [{ params: { ref: doc.name } }]);
}
const { ref } = Astro.params;
const entry = docs.find((d) => d.longname === ref);
const entry = docs.find((d) => d.name === ref);
if (!entry) {
return;
}
---

<ReferenceLayout frontmatter={{ title: entry.name || 'Reference', description: '' }} headings={[]}>
<h1>{entry!.name}</h1>
<JsDoc name={ref} />
<JsDoc name={entry.longname} />
</ReferenceLayout>

0 comments on commit 37a2ee5

Please sign in to comment.