Skip to content

Commit

Permalink
feat(website):Add mdx to Astro and configure for it. (#1354)
Browse files Browse the repository at this point in the history
* add mdx

* update

* update

* add special theming

* update

* update

* updates

* update

* update

* css changes

* format

* fix package lock
  • Loading branch information
theosanderson authored Mar 15, 2024
1 parent 3e12387 commit dde2c94
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 10 deletions.
3 changes: 2 additions & 1 deletion website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import node from '@astrojs/node';
import tailwind from '@astrojs/tailwind';
import Icons from 'unplugin-icons/vite';
import react from '@astrojs/react';
import mdx from '@astrojs/mdx';

// https://astro.build/config
export default defineConfig({
output: 'server',
integrations: [tailwind(), react()],
integrations: [tailwind(), react(), mdx()],
adapter: node({
mode: 'standalone',
}),
Expand Down
37 changes: 37 additions & 0 deletions website/package-lock.json

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

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"e2e:headed": "npx playwright test --headed"
},
"dependencies": {
"@astrojs/mdx": "^1.1.5",
"@astrojs/node": "^6.1.0",
"@emotion/react": "^11.11.4",
"@headlessui/react": "^1.7.18",
Expand Down
12 changes: 12 additions & 0 deletions website/src/layouts/MdLayout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import '../styles/mdcontainer.scss';
import BaseLayout from './BaseLayout.astro';
const { frontmatter } = Astro.props;
---

<BaseLayout title={frontmatter.title}>
<div class='mdContainer'>
<slot />
</div>
</BaseLayout>
8 changes: 0 additions & 8 deletions website/src/pages/governance/index.astro

This file was deleted.

23 changes: 23 additions & 0 deletions website/src/pages/governance/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: ../../layouts/MdLayout.astro
title: "Governance"
---


# Governance


Governance page goes here

<b>Bold</b>

_italic_ etc.

```
code blocks
are great
```

and `commands`

[Link](http://google.com)
2 changes: 1 addition & 1 deletion website/src/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ table, tr, td {

border-radius: 1rem;
display:flex
}
}
25 changes: 25 additions & 0 deletions website/src/styles/mdcontainer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.mdContainer{
@apply max-w-3xl mx-auto;
}

.mdContainer h1{
@apply text-2xl font-semibold text-main break-all my-3;
}

.mdContainer h2{
@apply text-xl font-semibold text-main break-all my-3;
}

.mdContainer h3{
@apply text-lg font-semibold text-main break-all my-3;

}

.mdContainer p{
@apply my-2;
}

.mdContainer a{
@apply text-main underline hover:font-semibold;
}

0 comments on commit dde2c94

Please sign in to comment.