Skip to content

Create a New Site

The @easy-web/create CLI scaffolds a new Astro site pre-configured with all easy-web packages:

Terminal window
pnpm create @easy-web my-site
cd my-site
pnpm install
pnpm dev

Bootstrap a new site instance manually:

Terminal window
pnpm create astro@latest my-site
cd my-site
Terminal window
pnpm add @easy-web/theme-core \
@easy-web/i18n \
@easy-web/content-blocks
src/layouts/Base.astro
---
import '@easy-web/theme-core/theme.css';
import { ThemeToggle, Header, Footer } from '@easy-web/content-blocks';
---
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
</head>
<body>
<Header>
<ThemeToggle slot="end" />
</Header>
<main>
<slot />
</main>
<Footer />
</body>
</html>
astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
i18n: {
defaultLocale: 'en',
locales: ['en', 'de'],
},
});
// Use localizedHref for locale-aware links
import { localizedHref } from '@easy-web/i18n';
const link = localizedHref('/about', 'de'); // → '/de/about'
const defaultLink = localizedHref('/about', 'en'); // → '/about'
my-site/
├── src/
│ ├── components/ # Site-specific components
│ ├── layouts/
│ │ └── Base.astro # Uses easy-web-theme-core + content-blocks
│ ├── pages/
│ │ ├── index.astro
│ │ └── [lang]/ # i18n routes
│ └── content/ # Astro content collections
├── public/
├── astro.config.mjs
└── package.json