Public-Facing Website

Every child app can have a public-facing marketing and documentation website. The subtheme-website repo is the reference implementation — clone it to create a website for your app.

Reference implementation: This site (subtheme.com) is built with the subtheme-website repo. It demonstrates the complete pattern: marketing homepage, section-based documentation, admin branding integration, dark/light mode, and the glassmorphism theme.

Quick Start

  1. Clone the website template
    git clone git@github.com:WaveNetworks/subtheme-website.git your-site
    cd your-site
    rm -rf .git
    git init
    git remote add origin git@github.com:YourOrg/your-site.git
  2. Update the bootstrap

    Edit site/bootstrap.php to point to your admin's common_auth.php path and update the branding fallback array with your app name.

  3. Replace content

    Update index.php with your marketing content. Replace docs sections in site/docs/ with your app's documentation.

  4. Update URL routing

    Edit .htaccess for your domain's URL structure.

  5. Deploy

    Upload to public_html/ on your production server alongside admin/ and your child app.

Architecture

The website is standalone PHP + HTML + CSS — no framework, no build tools, no npm, no database writes. It lives alongside the admin and child app repos in the same webroot:

public_html/ index.php ← Marketing homepage .htaccess ← Pretty URLs, security headers site/ ← Website files (this repo) header.php ← Shared nav, CSS loading footer.php ← Footer, JS loading bootstrap.php ← Admin branding integration style.css ← All website-specific CSS docs/ ← Documentation section partials js/ ← Theme switcher assets/ ← Screenshots, images admin/ ← Admin core repo (separate) your-app/ ← Your child app repo (separate)

Bootstrap Pattern

The website uses admin's common_auth.php to get branding data without requiring a login session:

<?php
// site/bootstrap.php — Minimal bootstrap for marketing site
include_once(__DIR__ . '/../admin/include/common_auth.php');
$site_branding = get_branding();
// Returns: site_name, logo_path, favicon_path, theme_color, etc.
Use common_auth.php, NEVER common.php. common.php includes a session guard that redirects unauthenticated visitors to the login page. common_auth.php provides the same helpers (get_branding(), h(), database access) without any session requirement.

CSS Stack

The website loads CSS from three repos in a specific order:

OrderFilePurpose
1/admin/assets/css/style.cssBase layout (sidebar, navbar)
2/admin/assets/css/bs-theme-overrides.cssDark/light mode Bootstrap overrides
3/child-app/assets/css/custom.cssGlassmorphism theme (swappable)
4Bootstrap Icons CDNIcons
5/site/style.cssYour website-specific overrides

Use absolute paths (/admin/assets/...) to load assets from sibling repos. Keep all your website CSS in a single site/style.css file.

Documentation System

The docs system uses section-based routing via .htaccess:

# .htaccess
RewriteRule ^docs$ site/docs.php [L,QSA]
RewriteRule ^docs/(.+)$ site/docs.php?section=$1 [L,QSA]

site/docs.php maintains a $sections array mapping slugs to labels, then includes the matching partial from site/docs/:

$sections = [
    'overview'  => 'Overview',
    'setup'     => 'Setup Guide',
    'features'  => 'Features',
    // Add your sections here
];

$section = $_GET['section'] ?? 'overview';
include __DIR__ . '/docs/' . $section . '.php';

To add a new section: create site/docs/{slug}.php, add it to the $sections array, and add to sitemap.xml.

Dark/Light Mode

The website inherits dark/light mode from admin's color-mode.js. Your site/style.css should include [data-bs-theme="light"] overrides for every glass panel and custom element:

/* Dark mode (default) */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
}

/* Light mode override */
[data-bs-theme="light"] .glass-panel {
    background: rgba(255, 255, 255, 0.85);
}

Key Rules

Template Repo

The complete reference implementation is available at:

git clone git@github.com:WaveNetworks/subtheme-website.git

This repo contains the full source for subtheme.com — marketing homepage, documentation system, admin preview gallery, dark/light mode, glassmorphism panels, and the Bootswatch theme switcher.