diff --git a/.gitignore b/.gitignore index 364d63714e..11da8e5640 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,17 @@ +### Astro ### +# Gitignore template for Astro projects +# Ignore content collection generated files +.astro +*astro_tmp* + ### CypressIO ### # gitignore template for the CypressIO, browser test framework # website: https://www.cypress.io/ -/packages/e2e/cypress/results/* -/packages/e2e/cypress/reports/* -/packages/e2e/cypress/videos/* -/packages/e2e/cypress/screenshots/* +cypress/results/* +cypress/reports/* +cypress/screenshots/* +cypress/videos/* ### Emacs ### # -*- mode: gitignore; -*- @@ -299,12 +305,6 @@ tags .history .ionide -# Support for Project snippet scope -.vscode/*.code-snippets - -# Ignore code-workspaces -*.code-workspace - ### WebStorm ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 @@ -444,7 +444,7 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# https://www.toptal.com/developers/gitignore/api/git,node,cypressio,linux,macos,windows,visualstudiocode,webstorm,vim,emacs +# https://www.toptal.com/developers/gitignore/api/git,node,astro,cypressio,linux,macos,windows,visualstudiocode,webstorm,vim,emacs packages/tools/map/data/map.png -packages/server/cache \ No newline at end of file +packages/server/cache diff --git a/packages/client/astro.config.ts b/packages/client/astro.config.ts index de7b8dceb6..f6ae7344a2 100644 --- a/packages/client/astro.config.ts +++ b/packages/client/astro.config.ts @@ -64,6 +64,7 @@ function getImageSize(image: string) { if (!imageCache.has(image)) { let path = fileURLToPath(new URL(`public/img/interface/${image}.png`, import.meta.url)), size = imageSize(path); + imageCache.set(image, size); } @@ -75,6 +76,7 @@ export default defineConfig({ srcDir: './', site: 'https://kaetram.com', trailingSlash: 'always', + experimental: { redirects: true }, integrations: [ webmanifest({ icon: 'public/icon.png', diff --git a/packages/client/middleware/index.ts b/packages/client/middleware/index.ts new file mode 100644 index 0000000000..7ddb3c4122 --- /dev/null +++ b/packages/client/middleware/index.ts @@ -0,0 +1,6 @@ +import { sequence } from 'astro/middleware'; +import { i18nMiddleware } from 'astro-i18n-aut'; + +const i18n = i18nMiddleware({ defaultLocale: 'en' }); + +export const onRequest = sequence(i18n); diff --git a/packages/client/package.json b/packages/client/package.json index 6b39259d17..80e3db526e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -29,7 +29,7 @@ "astro-compress": "^1.1.49", "astro-compressor": "^0.4.0", "astro-critters": "^1.1.39", - "astro-i18n-aut": "^0.0.21", + "astro-i18n-aut": "^0.1.2", "astro-robots-txt": "^0.5.0", "astro-seo-schema": "^2.2.0", "astro-webmanifest": "^0.6.0", diff --git a/yarn.lock b/yarn.lock index 6397209db3..1d5541e240 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3786,7 +3786,7 @@ __metadata: astro-compress: "npm:^1.1.49" astro-compressor: "npm:^0.4.0" astro-critters: "npm:^1.1.39" - astro-i18n-aut: "npm:^0.0.21" + astro-i18n-aut: "npm:^0.1.2" astro-robots-txt: "npm:^0.5.0" astro-seo-schema: "npm:^2.2.0" astro-webmanifest: "npm:^0.6.0" @@ -5348,15 +5348,17 @@ __metadata: languageName: node linkType: hard -"astro-i18n-aut@npm:^0.0.21": - version: 0.0.21 - resolution: "astro-i18n-aut@npm:0.0.21" +"astro-i18n-aut@npm:^0.1.2": + version: 0.1.2 + resolution: "astro-i18n-aut@npm:0.1.2" dependencies: + dedent: "npm:^0.7.0" fast-glob: "npm:^3.3.0" + fs-extra: "npm:^11.1.1" peerDependencies: - astro: ^2.6.1 + astro: ^2.8.0 kleur: ^4.1.4 - checksum: 4fc76bc564c8eb5d6db5c32b9e3956c85a28b1a75a6c90fff43761b37847eb5beb9efd35c21bb6fc3d881c082a050263f55d1b6d94b53fd6e58fac968e122c01 + checksum: 5a0b2972b10e8245bc3ea816f967ce375f4a961fc2d06bbd2767f1677df7f1d69225670c4f34ff345e0c43db7f4c2e4c038f76f85bf4a069e42c664a22f7aed5 languageName: node linkType: hard @@ -6816,6 +6818,13 @@ __metadata: languageName: node linkType: hard +"dedent@npm:^0.7.0": + version: 0.7.0 + resolution: "dedent@npm:0.7.0" + checksum: ca3f1755ff26262fd43c339faafd3e92c1b3265b132397fc702d97643173fc03f35209af8f93583a99f878c6a355300971dbd2a27e7e0a4af4380c7b38d907ae + languageName: node + linkType: hard + "deep-extend@npm:^0.6.0": version: 0.6.0 resolution: "deep-extend@npm:0.6.0" @@ -8660,7 +8669,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.0.0": +"fs-extra@npm:^11.0.0, fs-extra@npm:^11.1.1": version: 11.1.1 resolution: "fs-extra@npm:11.1.1" dependencies: