Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carlosulisesochoa/astro-i18n-multilanguage-blog
Astro + Multilanguage (i18n) + Static Blog System Example
https://github.com/carlosulisesochoa/astro-i18n-multilanguage-blog
astro blog english i18n multilanguage spanish theme
Last synced: about 1 month ago
JSON representation
Astro + Multilanguage (i18n) + Static Blog System Example
- Host: GitHub
- URL: https://github.com/carlosulisesochoa/astro-i18n-multilanguage-blog
- Owner: CarlosUlisesOchoa
- Created: 2024-08-01T02:32:08.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-18T19:07:53.000Z (6 months ago)
- Last Synced: 2024-11-08T06:12:21.279Z (3 months ago)
- Topics: astro, blog, english, i18n, multilanguage, spanish, theme
- Language: Astro
- Homepage: https://astro-i18n-blog.netlify.app/
- Size: 383 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Astro 4 + Multilanguage (i18n) + Blog System Example
### Take a look at this basic but pretty and clean example
![ff](https://github.com/user-attachments/assets/3715d032-1057-4844-87b3-4c0322fc9f33)
## Features
- π¨ Theme system (Light/Dark), it detect and set preferred browser theme
- π Language Switcher (ES/EN)
- βοΈ Linked translations via a reference property: no need for matching slugs between locales.
- ποΈ Allow adding pages for a new locale with minimal effort; use the default locale\* as a fallback for missing settings and strings.
- π·οΈ Content tags Γ‘ la WordPress
- πΊοΈ Sitemap support with translation links
- π‘ Localized RSS Feeds
- π Customizable URL structure, like `domain.tld/locale/directory/slug`
- πͺ½ Skip to content link for screen reader and keyboard users
- π©βπΌ Localized author profiles from a single data file
- π Secret/draft state to exclude posts from rendering
- π 404 Page not found page
- π Ultra minimal styling without CSS classes with [new.css](https://newcss.net/) (remove only two lines of code to remove it!)
- π `target="_blank"` for external links with [Rehype plugin](https://github.com/rehypejs/rehype-external-links)
- π Separate favicon for dev server to not get confused between dev and production
- β 100/100 Lighthouse performance
- β SEO-friendly with canonical URLs and OpenGraph data
- β Markdown & MDX support## π Project Structure
You'll see the following folders and files:
```text
βββ public/
βββ src/
βΒ Β βββ components/
βΒ Β βββ content/
βΒ Β βββ i18n/
βΒ Β β βββ i18n.ts β Set up locales here
βΒ Β β βββ uiStrings.js β Localized headings, labels, etc.
βΒ Β β βββ utilities β i18n-specific functions
βΒ Β βββ layouts/
βΒ Β βββ libs/
βΒ Β βββ styles/
βΒ Β βββ utilities/
βΒ Β βββ consts.ts β Settings loaded by astro.config.mjs
βΒ Β βββ env.d.ts
βΒ Β βββ header.ts β Settings for header menus, optionally per locale
βββ astro.config.mjs
βββ README.md
βββ package.json
βββ tsconfig.json
```Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
The `src/content/` directory contains collections of related markdown and MDX documents. A 'blog' collection has been defined already.
Any static assets, like images, can be placed in the `public/` directory.
## π§ Commands
All default commands can be run from the root of the project, from a terminal:
| Command | Action |
| :------------------------- | :----------------------------------------------- |
| `pnpm install` | Installs dependencies |
| `pnpm run dev` | Starts local dev server at `localhost:4321` |
| `pnpm run build` | Build your production site to `./dist/` |
| `pnpm run preview` | Preview your build locally, before deploying |
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm run astro -- --help` | Get help using the Astro CLI |## β TODO
You can check TODO-List at [TODO.md](./.github/TODO.md)
## Acknowledgements
- Special thanks to [@kslstn](https://github.com/kslstn) for the [astro-i18n-blog-starter](https://github.com/kslstn/astro-i18n-blog-starter), which served as a base for this version.