How this site is built
Published:
This post records how waneco.jp and this blog (blog.waneco.jp) are built.
Goals
- The sites live on a shared rental server, so the output is static HTML only. No server-side features (SSR, APIs, databases).
- Each subdomain is its own site, but they share the look and the multilingual setup.
- Few dependencies and a light footprint. No external analytics, ads, or web-font loading.
Layout
Astro runs in static mode (output: 'static'), and npm workspaces keep everything in one repository.
packages/
shared/ shared parts (layout, header, footer, i18n dictionary, site list)
sites/
www/ waneco.jp
blog/ blog.waneco.jp
scripts/
check.mjs checks the build output
dist/
www/ ← uploaded to waneco.jp
blog/ ← uploaded to blog.waneco.jp
Adding a subdomain means adding one folder under sites/ and one entry to the shared site list. Each site’s astro.config.mjs just calls the shared config.
import { defineConfig } from 'astro/config';
import { siteConfig } from '@waneco/shared/config.ts';
export default defineConfig(siteConfig('blog'));
Languages
Japanese is the default at /, and English lives under /en/. Page bodies are components that take the language as a prop, so src/pages/ and src/pages/en/ only hold thin entry files. Every page links to its counterpart and carries hreflang tags.
Posts are Markdown files in src/content/posts/ja/ and src/content/posts/en/; files with the same name are treated as translations of each other.
Build and check
npm ci
npm run build # produces dist/www and dist/blog
npm run check # broken links, hreflang, lang attributes, forbidden words
npm run check is a small script that reads every built HTML file and confirms that each link target exists in dist/, including links between the sites.
Deploying
Each folder inside dist/ is uploaded over FTP to the public folder of its subdomain. The build runs locally and the resulting HTML is uploaded as-is.