diff --git a/package.json b/package.json index 7e9368b..d0e1734 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@astrojs/mdx": "^4.3.13", "@astrojs/preact": "^4.1.3", "astro": "^5.16.5", + "github-markdown-css": "^5.8.1", "preact": "^10.28.0" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64b9114..ad3d729 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ astro: specifier: ^5.16.5 version: 5.16.5(@types/node@25.0.2)(rollup@4.53.3)(typescript@5.9.3) + github-markdown-css: + specifier: ^5.8.1 + version: 5.8.1 preact: specifier: ^10.28.0 version: 10.28.0 @@ -1032,6 +1035,10 @@ resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} + github-markdown-css@5.8.1: + resolution: {integrity: sha512-8G+PFvqigBQSWLQjyzgpa2ThD9bo7+kDsriUIidGcRhXgmcaAWUIpCZf8DavJgc+xifjbCG+GvMyWr0XMXmc7g==} + engines: {node: '>=10'} + github-slugger@2.0.0: resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} @@ -2964,6 +2971,8 @@ get-east-asian-width@1.4.0: {} + github-markdown-css@5.8.1: {} + github-slugger@2.0.0: {} h3@1.15.4: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..d0b7dbe --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +onlyBuiltDependencies: + - esbuild + - sharp diff --git a/src/components/Counter.jsx b/src/components/Counter.jsx index 801eefe..fad5b8b 100644 --- a/src/components/Counter.jsx +++ b/src/components/Counter.jsx @@ -1,18 +1,18 @@ import { useState } from 'preact/hooks'; export default function Counter({ children }) { - const [count, setCount] = useState(0); - const add = () => setCount((i) => i + 1); - const subtract = () => setCount((i) => i - 1); + const [count, setCount] = useState(0); + const add = () => setCount((i) => i + 1); + const subtract = () => setCount((i) => i - 1); - return ( - <> -
- -
{count}
- -
-
{children}
- - ); + return ( + <> +
+ +
{count}
+ +
+
{children}
+ + ); } diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro new file mode 100644 index 0000000..4a563ab --- /dev/null +++ b/src/layouts/MarkdownLayout.astro @@ -0,0 +1,29 @@ +--- +import "github-markdown-css"; +--- + + + + + + +
+ +
+ + + + diff --git a/src/pages/index.mdx b/src/pages/index.mdx index df0dd47..62876ef 100644 --- a/src/pages/index.mdx +++ b/src/pages/index.mdx @@ -1,14 +1,18 @@ +--- +layout: ../layouts/MarkdownLayout.astro +--- + import Counter from '../components/Counter.jsx'; import Title from '../components/Title.astro'; export const components = { h1: Title }; export const authors = [ - { name: 'Jane', email: 'hi@jane.com' }, - { name: 'John', twitter: '@john2002' }, + { name: 'Jane', email: 'hi@jane.com' }, + { name: 'John', twitter: '@john2002' }, ]; export const published = new Date('2022-02-01'); -# Hello world! +# Hello world Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}.