diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-02-23 22:57:27 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-02-23 22:57:27 -0500 |
| commit | f373ead95fb5beb962c376b5b7b46dfde8ac4e57 (patch) | |
| tree | c99df23521ff2a5e5e2e4627c525a5e99dc2e3ae /src/web/config.php | |
| parent | add 96x96 logo (diff) | |
| download | website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.gz website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.bz2 website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.zip | |
update website to work with crimson framework
Diffstat (limited to '')
| -rw-r--r-- | src/web/config.php | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/web/config.php b/src/web/config.php index 8689b8e..4a4e830 100644 --- a/src/web/config.php +++ b/src/web/config.php @@ -1,26 +1,33 @@ <?php /* Copyright (c) 2024 Freya Murphy */ -// ENVIRONMENT +// CONFIG +// config values needed across the website // -// devlopment - do not cache any assets -// - use http host provided by user +// domain - the default domain for the website // -// production - use generated timestamps for each file -// - hard code http host to 'domain' lang string +// allowed_hosts - accepted domains to use for the website // -define('ENVIRONMENT', 'devlopment'); - -// CONFIG +// base_path - the base path the website is located at // -// config values needed across the website - -define('CONFIG', array( +// theme_color - html hex color used for browser metadata +// +// routes - array of regex keys that match the request path and +// - place it with the value if it matches +// - e.g. '' => 'home' sends / to /home +// +// style - single or list of css styles to load on specific routes +// +// js - single or list of js script to load on specific routes +// +// autoload - list of directories to autoload all PHP files in them +// +define('SITE_CONFIG', array( /* core config settings */ - 'domain' => 'freya.cat', - 'allowed_hosts' => ['freya.cat', 'www.freya.cat'], - 'base_path' => '/', + 'domain' => getenv("WEBSITE_HOST"), + 'allowed_hosts' => explode(" ", getenv("WEBSITE_ALLOWED_HOSTS")), + 'base_path' => getenv("WEBSITE_BASE_PATH"), 'theme_color' => '#181818', - 'git_url' => 'https://g.freya.cat/freya', + 'git_url' => 'https://g.freya.cat', /* route overides */ 'routes' => array( '' => 'home', @@ -39,4 +46,8 @@ define('CONFIG', array( 'js' => array( 'blog' => 'js/prism.js', ), + /* directories to autoload php code */ + 'autoload' => array('/third_party', '/lib'), )); + +define('ASSET_ROOT', PHP_ROOT . '/assets'); |