-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '1d7ab17f64d675555162f20bb0092be09788d626'
- Loading branch information
Showing
69 changed files
with
1,331 additions
and
953 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
11 changes: 0 additions & 11 deletions
11
inlang/packages/paraglide/paraglide-astro/example/README.md
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 |
---|---|---|
@@ -1,13 +1,2 @@ | ||
# Astro + Paraglide Example | ||
This is an example project of how to use Paraglide with Astro. It properly switches between languages, demonstrates the fine-grained message splitting, and handles SEO properly. | ||
|
||
Here are some interesting files to look at: | ||
- `src/middleware` - Set's the language based on the URL | ||
- `src/layouts/HTML.astro` - Shows how to set the `lang` attribute on the `<html>` tag | ||
- `src/components/BaseHead.astro` - Shows how to set the `rel="alternate"` links for SEO | ||
- `src/components/Counter.astro` - Shows how to use Paraglide on an Island | ||
- `src/pages/index.astro` - Shows how to use Paraglide on a page. Since these are not Islands, they are not included in the JS bundle. | ||
|
||
We encourage you to run the `build` command and inspect the output. You will notice that only the messages used on the client are shipped in the JS bundle. This is despite no manual message-splitting having been done. This is because Paraglide generates **tree-shakeable** code for your messages. That's the power of Paraglide! | ||
|
||
This example also has `@inlang/paraglide-vite` set up, which automatically re-runs the compile on message changes. This is not required, but it makes development much easier. You can see how it's set up in `astro.config.mjs`. |
18 changes: 1 addition & 17 deletions
18
inlang/packages/paraglide/paraglide-astro/example/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
55 changes: 27 additions & 28 deletions
55
inlang/packages/paraglide/paraglide-astro/example/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 |
---|---|---|
@@ -1,30 +1,29 @@ | ||
{ | ||
"name": "@inlang/paraglide-astro-example", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"private": "true", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "paraglide-js compile --project ./project.inlang && astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/node": "^9.0.1", | ||
"@astrojs/sitemap": "3.2.1", | ||
"@astrojs/svelte": "^7.0.3", | ||
"astro": "^5.1.6", | ||
"@astrojs/check": "^0.9.4", | ||
"typescript": "^5.5.2", | ||
"svelte": "^5.17.5" | ||
}, | ||
"files": [ | ||
"*", | ||
".gitignore" | ||
], | ||
"devDependencies": { | ||
"@inlang/paraglide-astro": "workspace:*", | ||
"@inlang/paraglide-js": "workspace:*" | ||
} | ||
"name": "@inlang/paraglide-astro-example", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"private": "true", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "paraglide-js compile --project ./project.inlang && astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/node": "^9.0.1", | ||
"@astrojs/svelte": "^7.0.3", | ||
"astro": "^5.1.6", | ||
"@astrojs/check": "^0.9.4", | ||
"typescript": "^5.5.2", | ||
"svelte": "^5.17.5" | ||
}, | ||
"files": [ | ||
"*", | ||
".gitignore" | ||
], | ||
"devDependencies": { | ||
"@inlang/paraglide-astro": "workspace:*", | ||
"@inlang/paraglide-js": "workspace:*" | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
inlang/packages/paraglide/paraglide-astro/src/ambient.d.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.