{entry.data.title}
++
{entry.data.title}
++ > + ); + }) + }
diff --git a/examples/with-markdoc/src/content/blog/plain-md.md b/examples/with-markdoc/src/content/blog/plain-md.md new file mode 100644 index 0000000000..4a75a9f4bc --- /dev/null +++ b/examples/with-markdoc/src/content/blog/plain-md.md @@ -0,0 +1,8 @@ +--- +title: Markdown +--- + +## Just markdown + +- working? +- yes. diff --git a/examples/with-markdoc/src/content/blog/test.mdoc b/examples/with-markdoc/src/content/blog/test.mdoc index 4b1c275469..849e2f2690 100644 --- a/examples/with-markdoc/src/content/blog/test.mdoc +++ b/examples/with-markdoc/src/content/blog/test.mdoc @@ -1,8 +1,8 @@ --- -title: Example! +title: Markdoc --- -# Hey there +# Markdoc h2 Look at this table! Built-in to Markdoc, neat. diff --git a/examples/with-markdoc/src/pages/index.astro b/examples/with-markdoc/src/pages/index.astro index 5b8b67a9a7..3a9ef6e835 100644 --- a/examples/with-markdoc/src/pages/index.astro +++ b/examples/with-markdoc/src/pages/index.astro @@ -2,14 +2,10 @@ import { Markdoc } from '@astrojs/markdoc'; import { Code } from 'astro/components'; import Marquee from '../components/Marquee.astro'; -import { getEntryBySlug } from 'astro:content'; +import { getCollection } from 'astro:content'; import RedP from '../components/RedP.astro'; -const mdocEntry = await getEntryBySlug('blog', 'test'); -const mdxEntry = await getEntryBySlug('blog', 'with-mdx'); -console.log(mdocEntry); -const { Content } = await mdocEntry.render(); -const { Content: MDXContent } = await mdxEntry.render(); +const entries = await getCollection('blog'); --- @@ -23,23 +19,42 @@ const { Content: MDXContent } = await mdxEntry.render();