Skip to content

Commit

Permalink
feat: add adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanyawat-Arsaga committed Apr 1, 2024
1 parent 3711c88 commit fd37423
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/astro/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store
.netlify
9 changes: 6 additions & 3 deletions apps/astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pandacss from '@pandacss/astro';
import { defineConfig } from 'astro/config';

import react from '@astrojs/react';

import netlify from "@astrojs/netlify";

// https://astro.build/config
export default defineConfig({
i18n: {
Expand All @@ -13,5 +14,7 @@ export default defineConfig({
redirectToDefaultLocale: true
}
},
integrations: [pandacss(), react()]
});
integrations: [pandacss(), react()],
output: 'hybrid',
adapter: netlify()
});
1 change: 1 addition & 0 deletions apps/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@ark-ui/react": "^2.2.3",
"@astrojs/check": "^0.5.10",
"@astrojs/netlify": "^5.2.0",
"@astrojs/react": "^3.1.0",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
Expand Down
5 changes: 5 additions & 0 deletions apps/astro/src/i18n/paths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { languages } from './ui';

export const localePaths = (Object.keys(languages) as (keyof typeof languages)[]).map((locale) => {
return { params: { locale } };
});
5 changes: 5 additions & 0 deletions apps/astro/src/pages/[locale]/about/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
import { localePaths } from '~/i18n/paths';
//TODO:
export async function getStaticPaths() {
return localePaths;
}
---
3 changes: 2 additions & 1 deletion apps/astro/src/pages/[locale]/contact/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import { Box, Center, Grid, HStack, Stack, styled } from 'styled-system/jsx';
import { NAMECARDS } from '../../../constants/namecard';
import { localePaths } from '~/i18n/paths';
import MainLayout from '~/layouts/MainLayout.astro';
export async function getStaticPaths() {
return [{ params: { locale: 'en' } }, { params: { locale: 'ja' } }];
return localePaths
}
// <styled.p fontSize="xs" textAlign="center" fontStyle="italic">
// Pと書いてあるけどプロデューサーじゃないからね。
Expand Down
3 changes: 2 additions & 1 deletion apps/astro/src/pages/[locale]/index.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
import { css } from 'styled-system/css';
import { localePaths } from '~/i18n/paths';
import MainLayout from '~/layouts/MainLayout.astro';
export async function getStaticPaths() {
return [{ params: { locale: 'en' } }, { params: { locale: 'ja' } }];
return localePaths;
}
const param = Astro.params;
Expand Down
5 changes: 5 additions & 0 deletions apps/astro/src/pages/[locale]/namecard/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
import { localePaths } from '~/i18n/paths';
//TODO:
export async function getStaticPaths() {
return localePaths;
}
---
2 changes: 2 additions & 0 deletions apps/astro/src/pages/[locale]/notes/[id]/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
export const prerender = false;
//TODO:
---
5 changes: 5 additions & 0 deletions apps/astro/src/pages/[locale]/notes/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
import { localePaths } from '~/i18n/paths';
//TODO:
export async function getStaticPaths() {
return localePaths;
}
---
3 changes: 3 additions & 0 deletions apps/astro/src/pages/[locale]/projects/[id]/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
export const prerender = false;
//TODO:
---

5 changes: 5 additions & 0 deletions apps/astro/src/pages/[locale]/projects/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
import { localePaths } from '~/i18n/paths';
//TODO:
export async function getStaticPaths() {
return localePaths;
}
---
3 changes: 3 additions & 0 deletions apps/astro/src/pages/[locale]/tags/[id]/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
export const prerender = false;
//TODO:
---

5 changes: 5 additions & 0 deletions apps/astro/src/pages/[locale]/tags/index.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
import { localePaths } from '~/i18n/paths';
//TODO:
export async function getStaticPaths() {
return localePaths;
}
---
2 changes: 1 addition & 1 deletion apps/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"paths": {
"~/*": ["./*"],
"i18n/*": ["../../../libs/i18n/*"],
"styled-system/*": ["./styled-system/*"]
"styled-system/*": ["../styled-system/*"]
}
},
"include": ["src", "styled-system"]
Expand Down
39 changes: 38 additions & 1 deletion pnpm-lock.yaml

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

0 comments on commit fd37423

Please sign in to comment.