update with-tailwind example to use mdx (#5104)
* add mdx since md is deprecated now * rename .md -> .mdx * fix component import * yarn format
This commit is contained in:
parent
d7407dbb15
commit
66e8ae3bee
5 changed files with 18 additions and 12 deletions
|
@ -1,7 +1,8 @@
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
import mdx from '@astrojs/mdx';
|
||||||
import tailwind from '@astrojs/tailwind';
|
import tailwind from '@astrojs/tailwind';
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [tailwind()],
|
integrations: [mdx(), tailwind()],
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/mdx": "^0.11.4",
|
||||||
"@astrojs/tailwind": "^2.1.0",
|
"@astrojs/tailwind": "^2.1.0",
|
||||||
"@types/canvas-confetti": "^1.4.3",
|
"@types/canvas-confetti": "^1.4.3",
|
||||||
"astro": "^1.5.0",
|
"astro": "^1.5.0",
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
title: 'Markdown + Tailwind'
|
|
||||||
layout: ../layouts/main.astro
|
|
||||||
setup: |
|
|
||||||
import Button from '../components/Button.astro';
|
|
||||||
---
|
|
||||||
|
|
||||||
<div class="grid place-items-center h-screen content-center">
|
|
||||||
<Button>Tailwind Button in Markdown!</Button>
|
|
||||||
<a href="/" class="p-4 underline">Go home...</a>
|
|
||||||
</div>
|
|
13
examples/with-tailwindcss/src/pages/markdown-page.mdx
Normal file
13
examples/with-tailwindcss/src/pages/markdown-page.mdx
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
title: 'Markdown + Tailwind'
|
||||||
|
layout: ../layouts/main.astro
|
||||||
|
---
|
||||||
|
|
||||||
|
import Button from '../components/Button.astro';
|
||||||
|
|
||||||
|
<div class="grid place-items-center h-screen content-center">
|
||||||
|
<Button>Tailwind Button in Markdown!</Button>
|
||||||
|
<a href="/" class="p-4 underline">
|
||||||
|
Go home...
|
||||||
|
</a>
|
||||||
|
</div>
|
|
@ -326,6 +326,7 @@ importers:
|
||||||
|
|
||||||
examples/with-tailwindcss:
|
examples/with-tailwindcss:
|
||||||
specifiers:
|
specifiers:
|
||||||
|
'@astrojs/mdx': ^0.11.4
|
||||||
'@astrojs/tailwind': ^2.1.0
|
'@astrojs/tailwind': ^2.1.0
|
||||||
'@types/canvas-confetti': ^1.4.3
|
'@types/canvas-confetti': ^1.4.3
|
||||||
astro: ^1.5.0
|
astro: ^1.5.0
|
||||||
|
@ -334,6 +335,7 @@ importers:
|
||||||
postcss: ^8.4.14
|
postcss: ^8.4.14
|
||||||
tailwindcss: ^3.0.24
|
tailwindcss: ^3.0.24
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@astrojs/mdx': link:../../packages/integrations/mdx
|
||||||
'@astrojs/tailwind': link:../../packages/integrations/tailwind
|
'@astrojs/tailwind': link:../../packages/integrations/tailwind
|
||||||
'@types/canvas-confetti': 1.4.3
|
'@types/canvas-confetti': 1.4.3
|
||||||
astro: link:../../packages/astro
|
astro: link:../../packages/astro
|
||||||
|
|
Loading…
Reference in a new issue