Skip to content

Commit

Permalink
update with-tailwind example to use mdx (#5104)
Browse files Browse the repository at this point in the history
* add mdx since md is deprecated now

* rename .md -> .mdx

* fix component import

* yarn format
  • Loading branch information
JLarky authored Oct 18, 2022
1 parent d7407db commit 66e8ae3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion examples/with-tailwindcss/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import tailwind from '@astrojs/tailwind';

// https://astro.build/config
export default defineConfig({
integrations: [tailwind()],
integrations: [mdx(), tailwind()],
});
1 change: 1 addition & 0 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^0.11.4",
"@astrojs/tailwind": "^2.1.0",
"@types/canvas-confetti": "^1.4.3",
"astro": "^1.5.0",
Expand Down
11 changes: 0 additions & 11 deletions examples/with-tailwindcss/src/pages/markdown-page.md

This file was deleted.

13 changes: 13 additions & 0 deletions examples/with-tailwindcss/src/pages/markdown-page.mdx
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66e8ae3

Please sign in to comment.