11---
2- import { getCollection , getEntry } from " astro:content" ;
3- import { CodeExample } from " astro-pigment/components/playground" ;
42import { Layout , PageHeading } from " astro-pigment/components" ;
5- import { getHref } from " astro-pigment/utils/urls" ;
3+ import { CodeExample } from " astro-pigment/components/playground" ;
4+ import { getHref , getMarkdownAlternate } from " astro-pigment/utils/urls" ;
5+ import { getCollection , getEntry } from " astro:content" ;
6+ import nanoTagsContextRaw from " nanotags:dist/context.mjs?raw" ;
67import nanoTagsRaw from " nanotags:dist/index.mjs?raw" ;
78import nanoTagsRenderRaw from " nanotags:dist/render.mjs?raw" ;
8- import nanoTagsContextRaw from " nanotags:dist/context.mjs?raw" ;
99import styles from ' ./styles.module.css' ;
1010
1111export async function getStaticPaths() {
@@ -27,11 +27,12 @@ const importOverrides = {
2727const example = await getEntry (" examples" , Astro .params .slug );
2828if (! example ) throw new Error (` Example '${Astro .params .slug }' not found ` );
2929const data = example .data
30+ const alt = getMarkdownAlternate (` examples/${Astro .params .slug } ` );
3031---
3132
32- <Layout title ={ data .title } >
33+ <Layout title ={ data .title } alternate = { [ alt ] } >
3334 <div class =" prose" >
34- <PageHeading title ={ data .title } href ={ getHref ( ` examples/${ example . id }.md ` ) } back ={ { href: getHref (' examples' ), label: ' All Examples' }} />
35+ <PageHeading title ={ data .title } href ={ alt . href } back ={ { href: getHref (' examples' ), label: ' All Examples' }} />
3536 { data .descriptionHtml && <p class = { styles .subtitle } set :html = { data .descriptionHtml } />}
3637 <CodeExample files ={ data .files } importOverrides ={ importOverrides } />
3738 <p class ={ styles .footerNote } >
0 commit comments