diff --git a/setup.php b/setup.php index 2d91aa6..566f93e 100644 --- a/setup.php +++ b/setup.php @@ -2,17 +2,13 @@ /** * Grav Multi-Site Setup Configuration * Maps hostnames to environment-specific directories - * - * Uses Grav's native environment-based multi-site feature. - * The environment is determined by hostname. + * Only overrides 'page' stream to serve environment-specific content */ -// Get the hostname from request $hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; $hostname = preg_replace('/:\d+$/', '', $hostname); $hostname = strtolower($hostname); -// Define supported hostnames $hostMap = [ 'charters.turnsys.com' => 'charters.turnsys.com', 'plan.afabn.org' => 'plan.afabn.org', @@ -38,22 +34,23 @@ $hostMap = [ 'staticsites.turnsys.com' => 'staticsites.turnsys.com', ]; -// Determine environment name (falls back to staticsites.turnsys.com) $environment = isset($hostMap[$hostname]) ? $hostMap[$hostname] : 'staticsites.turnsys.com'; $envPath = GRAV_ROOT . '/user/env/' . $environment; -// If environment directory doesn't exist, use default if (!is_dir($envPath)) { - $environment = 'staticsites.turnsys.com'; - $envPath = GRAV_ROOT . '/user/env/' . $environment; + $envPath = GRAV_ROOT . '/user/env/staticsites.turnsys.com'; } -// Set the Grav environment - this tells Grav to look for config in user/env/{environment}/ -// Grav will automatically handle stream prefixes based on this -if (!defined('GRAV_ENVIRONMENT')) { - define('GRAV_ENVIRONMENT', $environment); -} - -// Return empty array - Grav's native environment handling will take over -// based on the GRAV_ENVIRONMENT constant -return []; +// Only override page stream - use environment pages, fallback to default +return [ + 'streams' => [ + 'schemes' => [ + 'page' => [ + 'type' => 'ReadOnlyStream', + 'prefixes' => [ + '' => [$envPath . '/pages', 'user://pages'], + ], + ], + ], + ], +];