Skip to content

Commit

Permalink
Fix content collection upgrade issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugos68 committed Feb 13, 2025
1 parent c8c9c97 commit 8317c15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sites/next.skeleton.dev/src/components/docs/NavGrid.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const sortByOrder = (a: CollectionEntry<'docs'>, b: CollectionEntry<'docs'>) =>
collectionItems.sort(sortByOrder).map((item) => (
<>
<a
href={`/${collection}/${item.slug}`}
href={`/${collection}/${item.id}`}
class="card bg-surface-50-950 border-[1px] border-surface-200-800 hover:preset-tonal space-y-2 p-4 md:p-8"
>
<h3 class="h5">{item.data.title}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const tableData = await getCollection(collection, (item) => {
</td>
{/* <td class="text-right text-xs opacity-60">{row.data.pubDate?.toLocaleDateString()}</td> */}
<td class="text-right">
<a href={`/${collection}/${row.slug}`} class="btn preset-tonal hover:preset-filled">
<a href={`/${collection}/${row.id}`} class="btn preset-tonal hover:preset-filled">
Explore &rarr;
</a>
</td>
Expand Down
5 changes: 3 additions & 2 deletions sites/next.skeleton.dev/src/pages/docs/[...slug]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ export const getStaticPaths = (async () => {
const { page } = Astro.props;
const { Content, remarkPluginFrontmatter } = await render(page);
let meta: Awaited<ReturnType<typeof getEntry>>;
if (page.id.startsWith('components/')) {
const meta = await getEntry('docs', page.id.replace(/\/[^\/]*$/, '/meta'));
meta = await getEntry('docs', page.id.replace(/\/[^\/]*$/, '/meta'));
if (meta !== undefined) {
Object.assign(remarkPluginFrontmatter, meta.data);
}
}
---

<LayoutRoot title={meta ? meta.data.title : entry.data.title} description={meta ? meta.data.title : entry.data.description}>
<LayoutRoot title={meta ? meta.data.title : page.data.title} description={meta ? meta.data.title : page.data.description}>
<Content />
</LayoutRoot>

0 comments on commit 8317c15

Please sign in to comment.