# LandingForge

A complete Python script that generates a production-ready, SEO-optimized static landing page
website from configurable keywords. Outputs a complete website file structure (HTML, CSS, JS, PHP)
with a dark theme design, scroll animations, lazy loading, multi-language support,
auto-generated sitemap/robots.txt, and full SEO metadata — then configures Apache virtual host
and sets up HTTPS via Certbot.

## Features

- **Dark theme** with gradient accents, glassmorphism, and animated glow effects
- **WOW.js scroll animations** (bundled locally — no CDN)
- **Lazy loading** for images and sections
- **Multi-language support** (EN, ES, FR, DE, PT, JA) with auto-detect
- **SEO-optimized** meta tags, Open Graph, Twitter Cards, JSON-LD structured data
- **Auto-generated** sitemap.xml and robots.txt from keywords
- **PHP language detection** with cookie + Accept-Language header support
- **Self-hosted fonts** (Inter, JetBrains Mono) and Font Awesome icons
- **GDPR cookie banner** with category-level consent management
- **Apache virtual host** configuration generator
- **Certbot SSL** setup script

## Requirements

- Python 3.11+
- Dependencies: `jinja2`, `pyyaml`, `pillow`, `requests`

```bash
pip install -r requirements.txt
```

## Quick Start

```bash
# Install dependencies
pip install -r requirements.txt

# Generate the site using default config.yaml (output to current directory)
python landingforge.py

# Or specify config and output directory
python landingforge.py --config config.yaml --output /var/www/mysite

# Skip font/icon downloads (use system fallbacks)
python landingforge.py --skip-assets

# Skip deployment files
python landingforge.py --skip-deploy
```

## Configuration

Edit `config.yaml` to customise:

| Section | Description |
|---|---|
| `site` | Domain, brand name, tagline, contact email |
| `keywords` | Primary, secondary, and long-tail keywords |
| `seo` | Title template, OG image, Twitter handle, schema type |
| `languages` | Supported languages with flags and auto-detect |
| `design` | Colors, fonts, border radius, animation duration |
| `content` | Hero, features, how-to steps, FAQ, footer |
| `gdpr` | Cookie banner, categories, privacy policy URL |
| `deployment` | Apache/Certbot settings |

## Generated File Structure

```
output_dir/
├── index.html            # Main landing page
├── index.php             # PHP language redirector
├── about.html
├── privacy.html
├── terms.html
├── cookies.html
├── sitemap.xml
├── robots.txt
├── .htaccess
├── manifest.json
├── browserconfig.xml
├── lang/
│   ├── es/index.html
│   ├── fr/index.html
│   ├── de/index.html
│   ├── pt/index.html
│   └── ja/index.html
├── assets/
│   ├── css/              # main.css, animations.css, responsive.css, fontawesome.min.css
│   ├── js/               # main.js, wow.min.js, hero-animations.js, etc.
│   ├── fonts/            # Inter + JetBrains Mono (self-hosted)
│   ├── images/           # og-default.jpg, favicons, placeholder SVGs
│   └── webfonts/         # Font Awesome woff2 files
├── includes/
│   ├── detect-language.php
│   └── redirect.php
└── deploy/
    ├── apache-vhost.conf
    └── setup-ssl.sh
```

## Deployment

After generation:

1. **Copy files to server:**
   ```bash
   rsync -avz output/ root@yourdomain.com:/var/www/yourdomain/
   ```

2. **Configure Apache:**
   ```bash
   cp output/deploy/apache-vhost.conf /etc/apache2/sites-available/yourdomain.conf
   a2ensite yourdomain.conf
   systemctl reload apache2
   ```

3. **Set up SSL:**
   ```bash
   sudo bash output/deploy/setup-ssl.sh
   ```

## Project Structure

```
exchold/
├── landingforge.py          # Main entry point
├── config.yaml              # Default configuration
├── requirements.txt         # Python dependencies
├── generators/
│   ├── __init__.py
│   ├── html_generator.py    # HTMLGenerator — all HTML pages
│   ├── css_generator.py     # CSSGenerator — main/responsive/animations CSS
│   ├── js_generator.py      # JSGenerator — main.js, WOW.js, hero, lang, cookies
│   ├── php_generator.py     # PHPGenerator — index.php, language detection
│   ├── seo_generator.py     # SEOGenerator — sitemap, robots, .htaccess, manifest
│   ├── asset_generator.py   # AssetGenerator — OG image, favicons, SVGs, fonts
│   └── deploy_generator.py  # DeployGenerator — Apache vhost, SSL script
└── README.md
```

## CLI Options

```
usage: landingforge.py [-h] [--config CONFIG] [--output OUTPUT]
                       [--skip-deploy] [--skip-assets] [--verbose]

options:
  --config CONFIG   Path to YAML config file (default: config.yaml)
  --output OUTPUT   Output directory (default: from config)
  --skip-deploy     Skip Apache/Certbot deployment file generation
  --skip-assets     Skip font/icon downloads; use system fallbacks
  -v, --verbose     Enable debug logging
```

## License

MIT
