Skip to content

Commit

Permalink
perf(blog): add mdx support for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kamontat committed Dec 5, 2023
1 parent 929e1da commit 129d990
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/posts/first-post.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: First post
---
First!

You can edit this page in the [Admin UI](/keystatic/collection/posts/item/first-post), or directly in your IDE at `src/content/posts/first-post.mdoc`.
You can edit this page in the [Admin UI](/keystatic/collection/posts/item/first-post), or directly in your IDE at `src/content/posts/first-post.mdoc`.
30 changes: 30 additions & 0 deletions src/content/posts/second-post.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Second post
---

import Title from '@components/TestTitle.astro';
export const components = { h1: Title };

export const authors = [
{ name: 'Jane', email: 'hi@jane.com' },
{ name: 'John', twitter: '@john2002' },
];
export const published = new Date('2022-02-01');

# Hello world!

Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}.

Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}.

## Syntax highlighting

We also support syntax highlighting in MDX out-of-the-box! This example uses our default [Shiki theme](https://github.com/shikijs/shiki). See the [MDX integration docs](https://docs.astro.build/en/guides/integrations-guide/mdx/#syntax-highlighting) for configuration options.

```astro
---
const weSupportAstro = true;
---
<h1>Hey, what theme is that? Looks nice!</h1>
```

0 comments on commit 129d990

Please sign in to comment.