Minimal Astro 5 template for multilingual static sites. Zero config to start — just add content.
Built by Affiliate.FM — independent media and open-source tools for affiliate marketing.
npm create astro@latest -- --template affiliatefm/website-core-template
cd my-site
make devsrc/
├── components/global/ # Shared components (head/body)
├── content/pages/ # ✏️ Your content (MDX files)
│ ├── index.mdx # Homepage
│ ├── docs.mdx # Documentation
│ ├── _collections/ # Collection items (product pages)
│ │ ├── software/
│ │ │ └── ai-translator.mdx
│ │ └── websites/
│ │ └── ssg-directory.mdx
│ ├── software/ # Collection landing page
│ │ └── index.mdx
│ └── websites/ # Collection landing page
│ └── index.mdx
│ └── ru/ # Russian content
│ └── index.mdx
├── data/ # ✏️ Your configuration
│ ├── site.ts # Site URL, locales, template selection
│ └── ui.ts # UI translations
├── config/ # Runtime config (auto-generated)
├── i18n/ # URL helpers
├── integrations/ # Build checks
├── templates/affiliate/ # Core template
└── pages/ # Astro router
Your files (✏️) — edit freely, preserved by updates
Core files — updated via make update
Edit src/data/site.ts:
export const siteUrl = "https://your-domain.com";
export const locales = ["en", "ru"] as const;
export const defaultLocale = "en";
export const template = "affiliate" as const;Edit src/data/ui.ts:
export const uiStrings = {
en: { siteName: "My Site", homeLabel: "Home" },
ru: { siteName: "Мой сайт", homeLabel: "Главная" },
} as const;Add MDX files to src/content/pages/:
- Default language →
pages/about.mdx→/about/ - Other languages →
pages/ru/about.mdx→/ru/about/
| Command | Description |
|---|---|
make dev |
Start dev server |
make build |
Build for production |
make preview |
Preview build |
make update |
Update core from upstream |
Templates are convention-based folders in src/templates/:
-
Core templates:
src/templates/<id>/(updated bymake update) -
User templates:
src/templates/_<id>/(preserved bymake update) -
layout.astro— site layout (importsstyles.cssif needed) -
pages/home.astro,pages/article.astro,pages/product.astro -
styles.css— optional template stylesheet -
i18n.ts— optional template strings -
components/— optional template components
Template id is the folder name (use lowercase).
User templates keep the leading underscore in src/data/site.ts.
Page selection logic:
- Homepage (
index.mdx) →Home _collectionsitems →Product(or override viacollections[].page)- Everything else →
Article - Per-page override:
pagein frontmatter
pages/about.mdx → /about/
pages/ru/about.mdx → /ru/about/
Hreflang links generated automatically.
| Field | Type | Description |
|---|---|---|
title |
string | Page title (required) |
description |
string | Meta description |
updatedAt |
date | For sitemap |
draft |
boolean | Exclude from build |
link |
string | External URL (product pages) |
pros |
string[] | Pros list (product pages) |
cons |
string[] | Cons list (product pages) |
page |
string | Page template override ("home", "article", "product") |
# Check what would change
make update-check
# Apply update
make updatePreserved: src/content/, src/data/, src/templates/_*, public/
Updated: everything else
Automatic validation:
- ✓ Hreflang links are bidirectional
- ✓ All languages have UI strings
- ✓ No duplicate URLs
npx astro add tailwind
npx astro add react- astro-content-ai-translator — AI-powered translation for Astro. Auto-generates localized content from your content/ directory.
- astro-content-ai-enhancer — AI assistant that turns raw Markdown into structured, well-formatted pages while keeping the original voice.
Affiliate.FM — independent media and open-source tools for affiliate, performance, and digital marketing.
MIT