My tech blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

56 lines
1.4 KiB

<?php
defined('ROOT') || define('ROOT', realpath(__DIR__));
function try_read_hash(string $hash_file): ?string
{
$path = ROOT . "/public/assets/$hash_file";
if (!file_exists($path)) {
return null;
}
return file_get_contents($path);
}
if (file_exists(__DIR__ . '/.env')) {
(Dotenv\Dotenv::createImmutable(__DIR__))->load();
}
return [
'sentry-dsn' => getenv('SENTRY_DSN'),
'auth_token' => getenv('AUTH_TOKEN'),
'db' => getenv('DB_DSN'),
'resources' => [
'css' => [
'files' => [
ROOT . '/resources/assets/normalize.css',
ROOT . '/resources/assets/style.css',
ROOT . '/resources/assets/code-block-theme.css'
],
'output' => ROOT . '/public/assets/style.css',
'hash' => try_read_hash('style.css.sha')
],
'admin_css' => [
'files' => [
ROOT . '/resources/assets/spectre.min.css',
ROOT . '/resources/assets/admin.css',
],
'output' => ROOT . '/public/assets/admin.css',
'hash' => try_read_hash('admin.css.sha')
],
'templates' => ROOT . '/resources/templates',
'js' => [
'directory' => ROOT . '/resources/assets',
'output' => ROOT . '/public/assets',
'files' => [
'autocomplete.js' => ['hash' => try_read_hash('autocomplete.js.sha')],
'focusSearch.js' => ['hash' => try_read_hash('focusSearch.js.sha')],
'article-editor.js' => ['hash' => try_read_hash('article-editor.js.sha')],
]
]
],
'metadata' => [
'author' => 'Artemis',
'title' => "Artemis' blog"
]
];