mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-02 05:41:50 -04:00
fix: filter out internals
+ use name instead of longname for linking
This commit is contained in:
@@ -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="">
|
||||
|
||||
@@ -4,11 +4,11 @@ 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;
|
||||
}
|
||||
@@ -16,5 +16,5 @@ if (!entry) {
|
||||
|
||||
<ReferenceLayout frontmatter={{ title: entry.name || 'Reference', description: '' }} headings={[]}>
|
||||
<h1>{entry!.name}</h1>
|
||||
<JsDoc name={ref} />
|
||||
<JsDoc name={entry.longname} />
|
||||
</ReferenceLayout>
|
||||
|
||||
Reference in New Issue
Block a user