Part 1

セクションコンポーネントの概要

AstroGlassで利用可能なすべてのセクションコンポーネントの概要。

セクションコンポーネントは、各テーマページの構成要素です。各テーマページは12以上のセクションで構成されており、それぞれにテーマごとの専用バリアントがあります。

利用可能なセクション

仕組み

各セクションには、各テーマ(Liquid、Glass、Neo、Luxury、Minimal、Aurora)に対応する6つのテーマバリアントがあります。src/pages/[theme].astro の動的ページは、コンポーネントマップを使用して正しいバリアントをレンダリングします:

---
// [theme].astro からの簡略化
const componentMap = {
liquid: { Hero: HeroLiquid, About: AboutLiquid, ... },
glass: { Hero: HeroGlass, About: AboutGlass, ... },
// neo, luxury, minimal, aurora...
};
const components = componentMap[themeId];
---
<components.Hero />
<components.About />
<components.Features />
ℹ️
外部Propsなし

セクションコンポーネントはPropsを受け取りません。すべてのテキストコンテンツは、src/locales/{lang}/{section}.json から useTranslations() を介して内部的にロードされます。任意のセクションのコンテンツを変更するには、対応するロケールのJSONファイルを編集してください。

ファイル構造

各セクションは、一貫したディレクトリパターンに従っています:

src/components/sections/{section}/
├── {Section}Liquid.astro
├── {Section}Glass.astro
├── {Section}Neo.astro
├── {Section}Luxury.astro
├── {Section}Minimal.astro
└── {Section}Aurora.astro

各セクションのCSSは src/styles/components/{section}/ にあります。