-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(i18n): localised index pages are overwritten (#10250)
* fix(i18n): localised index pages are overwritten * chore: add changeset * chore: add pnpm lock
- Loading branch information
Showing
9 changed files
with
252 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": patch | ||
--- | ||
|
||
Fixes the overwriting of localised index pages with redirects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/astro/test/fixtures/i18n-routing-fallback-index/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { defineConfig } from "astro/config"; | ||
|
||
export default defineConfig({ | ||
base: "new-site", | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: [ | ||
'en', 'pt', 'it' | ||
], | ||
fallback: { | ||
"it": "en", | ||
pt: "en" | ||
} | ||
} | ||
}) |
8 changes: 8 additions & 0 deletions
8
packages/astro/test/fixtures/i18n-routing-fallback-index/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@test/i18n-routing-fallback-index", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"astro": "workspace:*" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/astro/test/fixtures/i18n-routing-fallback-index/src/pages/index.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html> | ||
<head> | ||
<title>Astro</title> | ||
<script> | ||
console.log("this is a script") | ||
</script> | ||
</head> | ||
<body> | ||
Hello | ||
</body> | ||
</html> | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
packages/astro/test/fixtures/i18n-routing-fallback-index/src/pages/pt/index.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
const currentLocale = Astro.currentLocale; | ||
--- | ||
|
||
<html> | ||
<head> | ||
<title>Astro</title> | ||
</head> | ||
<body> | ||
Oi essa e index: {currentLocale} | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
packages/astro/test/fixtures/i18n-routing-fallback/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.