Skip to content

Commit

Permalink
feat: tryna setup astro
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanyawat-Arsaga committed Mar 4, 2024
1 parent 98b9729 commit e434e0b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
13 changes: 10 additions & 3 deletions apps/astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { defineConfig } from 'astro/config';
import pandacss from '@pandacss/astro';
import { defineConfig } from 'astro/config';

import react from "@astrojs/react";
import react from '@astrojs/react';

// https://astro.build/config
export default defineConfig({
i18n: {
defaultLocale: 'en',
locales: ['en', 'ja'],
routing: {
prefixDefaultLocale: false
}
},
integrations: [pandacss(), react()]
});
});
2 changes: 1 addition & 1 deletion apps/astro/panda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export default defineConfig({
outdir: 'styled-system',

emitPackage: true,
lightningCss: true
lightningcss: true
});
13 changes: 0 additions & 13 deletions apps/astro/src/pages/[lang]/index.astro

This file was deleted.

15 changes: 15 additions & 0 deletions apps/astro/src/pages/[locale]/index.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
import { css } from 'styled-system/css';
import BaseLayout from '../../layouts/BaseLayout.astro';
export async function getStaticPaths() {
return [{ params: { locale: 'en' } }, { params: { locale: 'ja' } }];
}
const param = Astro.params;
---

<BaseLayout>
<h1 class={css({ fontSize: '3xl', fontWeight: 'bold' })}>Hello {param.locale}</h1>
</BaseLayout>
4 changes: 3 additions & 1 deletion apps/astro/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
---

<meta http-equiv="refresh" content="0;url=/en/" />
<h1>Hello World</h1>
<!-- <meta http-equiv="refresh" content="0;url=/en/" /> -->

0 comments on commit e434e0b

Please sign in to comment.