Skip to content

Commit

Permalink
Add description, correct routing in index
Browse files Browse the repository at this point in the history
  • Loading branch information
stalgiag committed Feb 29, 2024
1 parent 6e84f01 commit 44d0407
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/pages/reference/[...id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ const entriesById = referenceEntries.reduce((acc, entry) => {
return acc;
}, {});
const referenceEntry = entriesById[id];
const refEntry = entriesById[id];
---

<article>
<h1>{referenceEntry.data.title}</h1>
<h1>{refEntry.data.title}</h1>
<div set:html={refEntry.data.description} />
</article>
4 changes: 3 additions & 1 deletion src/pages/reference/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const referenceEntries = await getCollection("reference");
{
referenceEntries.map((refEntry: ReferenceDocContentItem) => (
<li>
<a href={`/reference/${refEntry.slug}`}>{refEntry.data.title}</a>
<a href={`/reference/${refEntry.id.replace(/\.mdx$/, "")}`}>
{refEntry.data.title}
</a>
</li>
))
}
Expand Down

0 comments on commit 44d0407

Please sign in to comment.