Skip to content

idimilabs/Astrology-i18n

Repository files navigation

Astrology i18n

A multilingual Astro 6 blog theme for content-first publishing

Astro Tailwind CSS Node License: MIT Demo

A polished, responsive Astro theme built for multilingual blogs, editorial sites, and personal publishing. It ships with locale-aware routes, centralized translations, SEO-ready defaults, optimized images, and a clean reading experience out of the box.

Lighthouse Score

Contents

Highlights

  • Multilingual by design: language-prefixed routes, centralized dictionaries, and fallback-friendly localization.
  • Content collections: typed frontmatter for posts, pages, and authors.
  • SEO ready: canonical URLs, Open Graph tags, JSON-LD, sitemap, and RSS feeds.
  • Fast by default: optimized images, prefetching, minimal client-side JavaScript, and Pagefind search.
  • Modern stack: Astro 6, Tailwind CSS 4, MDX, Partytown, and Cloudflare-ready static output.
  • Editorial layout: built for long-form reading, featured media, and clear content hierarchy.

Quick Start

Demo

Requirements

  • Node.js 20 or newer
  • pnpm

Install

git clone https://github.com/idimilabs/Astrology-i18n.git
cd Astrology-i18n
pnpm install

Run locally

pnpm run dev

Open http://localhost:4321 in your browser.

Build and preview

pnpm run build
pnpm run preview

pnpm run build outputs the static site to dist/.

Deploy

The project is configured for static deployment with Wrangler:

pnpm run deploy

Project Structure

.
├── public/                 # Static assets
├── src/
│   ├── assets/             # Optimized images and media
│   ├── components/         # Reusable UI pieces
│   ├── content/            # Posts, pages, and authors
│   ├── i18n/               # Translation dictionaries
│   ├── layouts/            # Page layouts
│   ├── pages/              # Route definitions
│   ├── styles/             # Global styles
│   ├── utils/              # Helpers and shared logic
│   └── content.config.ts   # Content collections schema
├── astro.config.mjs        # Astro configuration
└── package.json            # Scripts and dependencies

Internationalization

The theme supports 10 locales:

zh, en, fr, es, ru, ja, ko, pt, de, id

en is the default locale.

Add a new language

  1. Add the locale code to src/utils/i18n.ts.
  2. Update src/content.config.ts if the content schema needs to recognize the locale.
  3. Create a matching dictionary in src/i18n/<lang>.json.
  4. Adjust astro.config.mjs if you need sitemap or routing changes.

Routing behavior

Locale-aware pages live under src/pages/[lang]/. If a localized page is missing, you can fall back to the default language while keeping the locale URL structure intact.

Content Authoring

Posts live in src/content/posts/[lang]/. Pages and author profiles follow the same collection-driven pattern.

Example frontmatter:

---
title: "The Art of Star Gazing"
description: "A guide to observing the night sky."
pubDate: 2024-03-21
category: "Astronomy"
tags: ["Stars", "Night"]
author: "Astro Learner"
heroImage: "../assets/stars.jpg"
locales: "en"
---

Recommended practices:

  • Keep titles concise and descriptive.
  • Use description for search and social previews.
  • Add heroImage for posts that benefit from a strong visual lead.
  • Use locales to filter or scope content by language when needed.

Configuration

GitHub activity calendar

The author page can show a contribution calendar.

GITHUB_TOKEN=your_personal_access_token
  • Set GITHUB_TOKEN locally for development.
  • Add it to your deployment environment if you want live GitHub activity data in production.
  • Without the token, the site falls back gracefully.

Analytics

The project includes Partytown support for performance-friendly analytics. Configure your GTM or analytics IDs in src/components/analytics.

Search

Search is powered by Pagefind and is generated automatically during pnpm run build.

Formatting

Prettier is configured for the codebase.

pnpm run format

Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a branch for your change.
  3. Commit with a clear Conventional Commit message.
  4. Open a pull request.

License

MIT. See LICENSE for details.


Built with care by iDiMi

About

An Astro theme designed for impactful image-text blogging, now enhanced with multilingual support. Perfect for global content creators aiming to reach a diverse audience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors