Landing Page
Customize your landing page
Landing Page
Learn how to customize Chameleon's landing page content, layout, and styling.
Overview
The landing page is the main entry point for visitors and includes hero sections, feature highlights, pricing information, and call-to-action elements. All content is managed through translation files and can be customized for different languages.
Page Structure
Main Sections
- Hero Section - Main headline and call-to-action
- Features Section - Key feature highlights
- Pricing Section - Pricing plans and packages
- Testimonials - User reviews and feedback
- Footer - Links and company information
File Structure
src/app/[locale]/(default)/
├── page.tsx # Main landing page
├── layout.tsx # Page layout
└── components/
└── blocks/
├── hero.tsx # Hero section
├── features.tsx # Features section
├── pricing.tsx # Pricing section
└── footer.tsx # Footer section
Content Editing
Hero Section
Edit the hero section content:
// src/i18n/pages/landing/en.json
{
"hero": {
"title": "Generate AI Content with Chameleon",
"subtitle": "Create amazing images, videos, and text with the power of AI",
"cta_primary": "Get Started",
"cta_secondary": "Learn More"
}
}
// src/i18n/pages/landing/zh.json
{
"hero": {
"title": "使用 Chameleon 生成 AI 内容",
"subtitle": "利用 AI 的力量创建令人惊叹的图像、视频和文本",
"cta_primary": "开始使用",
"cta_secondary": "了解更多"
}
}
Features Section
// src/i18n/pages/landing/en.json
{
"features": {
"title": "Powerful AI Features",
"subtitle": "Everything you need to create amazing content",
"items": [
{
"title": "Image Generation",
"description": "Create stunning images with AI",
"icon": "image"
},
{
"title": "Video Creation",
"description": "Generate videos from text prompts",
"icon": "video"
}
]
}
}
Pricing Section
// src/i18n/pages/pricing/en.json
{
"pricing": {
"title": "Choose Your Plan",
"subtitle": "Flexible pricing for every need",
"plans": [
{
"name": "Starter",
"price": "$9",
"period": "month",
"features": [
"1,000 credits",
"Basic AI models",
"Email support"
]
}
]
}
}
Usage
Using Translations
// src/components/blocks/hero.tsx
import { useTranslations } from "next-intl";
export function Hero() {
const t = useTranslations("landing.hero");
return (
<section className="hero">
<h1>{t("title")}</h1>
<p>{t("subtitle")}</p>
<div className="cta-buttons">
<button className="btn-primary">{t("cta_primary")}</button>
<button className="btn-secondary">{t("cta_secondary")}</button>
</div>
</section>
);
}
Customizing Components
// src/components/blocks/features.tsx
import { useTranslations } from "next-intl";
export function Features() {
const t = useTranslations("landing.features");
return (
<section className="features">
<div className="container">
<h2>{t("title")}</h2>
<p>{t("subtitle")}</p>
<div className="features-grid">
{t.raw("items").map((feature: any, index: number) => (
<div key={index} className="feature-card">
<div className="feature-icon">
<Icon name={feature.icon} />
</div>
<h3>{feature.title}</h3>
<p>{feature.description}</p>
</div>
))}
</div>
</div>
</section>
);
}
File Locations
src/app/[locale]/(default)/page.tsx- Main landing pagesrc/components/blocks/hero.tsx- Hero section componentsrc/components/blocks/features.tsx- Features sectionsrc/components/blocks/pricing.tsx- Pricing sectionsrc/i18n/pages/landing/- Landing page translationssrc/i18n/pages/pricing/- Pricing page translations
Common Tasks
Update Hero Content
- Edit
src/i18n/pages/landing/en.json - Update title, subtitle, and CTA text
- Edit corresponding Chinese file
- Test changes on both languages
Add New Feature
- Add feature to
features.itemsarray in translation files - Update feature icon if needed
- Test feature display on landing page
Customize Pricing
- Edit
src/i18n/pages/pricing/en.json - Update plan names, prices, and features
- Update corresponding Chinese file
- Test pricing section display
Change Styling
// src/components/blocks/hero.tsx
export function Hero() {
return (
<section className="hero bg-gradient-to-r from-blue-500 to-purple-600">
<div className="container mx-auto px-4 py-20">
<h1 className="text-4xl font-bold text-white mb-4">
{t("title")}
</h1>
{/* ... */}
</div>
</section>
);
}
Troubleshooting
Content not updating
Problem: Changes to translation files not showing
Solution:
- Check file path is correct
- Verify JSON syntax is valid
- Clear browser cache
- Restart development server
Styling issues
Problem: Components not styled correctly
Solution:
- Check Tailwind CSS classes
- Verify component structure
- Check for CSS conflicts
- Test responsive design
Translation missing
Problem: Some text not translated
Solution:
- Check translation key exists
- Verify namespace is correct
- Check for typos in keys
- Test with different locales
Next Steps
- Internationalization - Multi-language support
- SEO - Landing page SEO
- Analytics - Track landing page performance