astroDeploy multilingual static websites on Cloudflare with Astro using markdown sources, supporting i18n, free hosting, and Git-based or direct deployment.
Install via ClawdBot CLI:
clawdbot install bezkom/astroDeploy multilingual static websites for free on Cloudflare using Astro framework.
npm create astro@latest my-site -- --template minimal
cd my-site
npm install
Static Sites (Recommended for most use cases)
No adapter needed. Use default static output:
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://your-site.pages.dev',
});
SSR/Edge Functions (Optional)
If you need server-side rendering or edge functions:
npm install @astrojs/cloudflare
// astro.config.mjs
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
export default defineConfig({
output: 'server',
adapter: cloudflare(),
site: 'https://your-site.pages.dev',
});
Git Integration (Recommended)
npm run builddistDirect Upload
# Deploy (authenticate via Cloudflare dashboard or wrangler)
npx wrangler pages deploy dist
// astro.config.mjs
export default defineConfig({
i18n: {
defaultLocale: 'en',
locales: ['en', 'es', 'fr', 'de'],
routing: {
prefixDefaultLocale: false, // /about instead of /en/about
},
},
});
Routing Modes:
| Setting | URL Structure | Best For |
|---------|--------------|----------|
| prefixDefaultLocale: false | /about, /es/about | Default locale at root |
| prefixDefaultLocale: true | /en/about, /es/about | All locales prefixed |
src/content/
βββ config.ts # Content collection schema
βββ docs/
βββ en/
β βββ index.md
β βββ guide.md
βββ es/
β βββ index.md
β βββ guide.md
βββ fr/
βββ index.md
βββ guide.md
// src/content/config.ts
import { defineCollection, z } from 'astro:content';
const docs = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
lang: z.enum(['en', 'es', 'fr', 'de']),
}),
});
export const collections = { docs };
Note: Run npx astro sync after adding content collections to generate types.
---
// src/components/LanguageSwitcher.astro
const languages = {
en: 'English',
es: 'EspaΓ±ol',
fr: 'FranΓ§ais',
de: 'Deutsch',
};
const currentPath = Astro.url.pathname;
const currentLang = Astro.currentLocale || 'en';
---
<select onchange="window.location = this.value">
{Object.entries(languages).map(([code, name]) => (
<option
value={`/${code}${currentPath}`}
selected={code === currentLang}
>
{name}
</option>
))}
</select>
my-site/
βββ astro.config.mjs # Astro configuration
βββ package.json
βββ public/
β βββ favicon.svg
β βββ _redirects # Cloudflare redirects (optional)
βββ src/
β βββ components/
β β βββ LanguageSwitcher.astro
β βββ content/
β β βββ config.ts
β β βββ blog/
β β βββ en/
β β βββ es/
β βββ layouts/
β β βββ BaseLayout.astro
β βββ pages/
β βββ index.astro
β βββ en/
β β βββ index.astro
β βββ es/
β βββ index.astro
| Setting | Value |
|---------|-------|
| Build command | npm run build |
| Build output | dist |
| Node version | 20 |
| Environment | NODE_VERSION=20 |
Cloudflare Dashboard β Pages β your-site β Custom domains β Add domain
Create public/_redirects:
/ /en/ 302
/old-page /new-page 301
| Command | Description |
|---------|-------------|
| npm run dev | Start dev server |
| npm run build | Build for production |
| npm run preview | Preview production build |
| npx astro sync | Generate content collection types |
| npx wrangler login | Authenticate with Cloudflare |
| npx wrangler pages deploy dist | Deploy to Cloudflare |
---
// src/pages/blog/[...slug].astro
import { getCollection } from 'astro:content';
export async function getStaticPaths() {
const posts = await getCollection('blog');
return posts.map(post => ({
params: { slug: post.slug },
props: { post },
}));
}
const { post } = Astro.props;
const { Content } = await post.render();
---
<article>
<h1>{post.data.title}</h1>
<Content />
</article>
Set NODE_VERSION=20 in Cloudflare Pages environment variables.
// astro.config.mjs
export default defineConfig({
trailingSlash: 'always',
});
Ensure:
lang frontmatternpx astro sync after creating content collectionsRun npx astro sync to generate TypeScript types.
| Script | Description |
|--------|-------------|
| astro-new-post.py | Create multilingual blog posts |
| astro-i18n-check.py | Validate translation coverage |
# Create a new post in multiple languages
python scripts/astro-new-post.py --title "My Post" --langs en,es,fr
# Create with author and tags
python scripts/astro-new-post.py --title "Tutorial" --langs en,es --author "John" --tags tutorial,astro
# Check translation coverage
python scripts/astro-i18n-check.py --langs en,es,fr
# Check specific content directory
python scripts/astro-i18n-check.py --content-dir src/content/blog --langs en,es
# Output as JSON
python scripts/astro-i18n-check.py --langs en,es,fr --json
All scripts use only Python standard library (no dependencies).
Generated Feb 28, 2026
A company needs a static website to showcase services and blog content in multiple languages for global audiences. Astro enables easy i18n setup with content collections, allowing separate markdown files per language, and Cloudflare Pages provides free hosting with fast global CDN distribution.
An individual blogger wants to share content in their native language and English to attract a wider audience. Using Astro, they can structure markdown posts in folders by locale, deploy for free on Cloudflare, and integrate a language switcher for seamless navigation between translations.
An open-source project requires a static site to host documentation that supports multiple languages to cater to a diverse contributor base. Astro's content collections allow organizing docs by language, while Cloudflare Pages ensures reliable, cost-free deployment with easy Git integration for updates.
An organization is hosting an international conference and needs a landing page with event details in different languages. Astro facilitates quick setup of multilingual pages using i18n routing, and Cloudflare Pages enables rapid deployment and scaling to handle traffic spikes during registration periods.
A freelancer wants to create a portfolio website that showcases work samples and testimonials in multiple languages to appeal to clients worldwide. Astro's static generation from markdown simplifies content management, and free hosting on Cloudflare reduces operational costs while maintaining high performance.
Offer a basic free tier for static site hosting on Cloudflare Pages with limited features, then charge for premium add-ons like custom domains, advanced analytics, or priority support. This leverages Astro's ease of deployment to attract users who later upgrade for enhanced functionality.
Provide web development and consulting services to businesses needing multilingual static websites. Use Astro to build and deploy sites efficiently, charging clients for design, i18n configuration, and ongoing maintenance, with Cloudflare Pages as the hosting solution to keep costs low.
Create a platform where users can publish multilingual blogs or documentation sites using Astro templates. Generate revenue through advertising, sponsored content, or premium features like SEO tools and custom integrations, while hosting on Cloudflare to minimize infrastructure expenses.
π¬ Integration Tip
Ensure Node.js 20+ is installed and run 'npx astro sync' after configuring content collections to avoid TypeScript errors and enable proper i18n functionality.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.