feat: titre et claim configurables depuis l'admin
This commit is contained in:
@@ -100,7 +100,7 @@ body {
|
||||
vertical-align: .2em;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
.navbar .nav-link {
|
||||
color: rgba(255,255,255,.85) !important;
|
||||
font-weight: 500;
|
||||
font-size: 0.9rem;
|
||||
@@ -109,8 +109,8 @@ body {
|
||||
transition: color 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.nav-link:hover,
|
||||
.nav-link:focus {
|
||||
.navbar .nav-link:hover,
|
||||
.navbar .nav-link:focus {
|
||||
color: #fff !important;
|
||||
background-color: rgba(255,255,255,.15);
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
define('BASE_PATH', realpath(__DIR__ . '/../'));
|
||||
|
||||
require_once BASE_PATH . '/src/auth.php';
|
||||
require_once BASE_PATH . '/src/SiteSettings.php';
|
||||
require_once BASE_PATH . '/config/config.php';
|
||||
require_once BASE_PATH . '/src/ArticleManager.php';
|
||||
require_once BASE_PATH . '/src/Parsedown.php';
|
||||
@@ -70,9 +71,9 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:fh="http://purl.org/syndication/history/1.0">
|
||||
<channel>
|
||||
<title>varlog</title>
|
||||
<title><?= htmlspecialchars(siteTitle()) ?></title>
|
||||
<link><?= htmlspecialchars($base) ?></link>
|
||||
<description>Journal personnel de Cédrix — informatique, hack et loisirs techniques.</description>
|
||||
<description><?= htmlspecialchars(siteClaim()) ?></description>
|
||||
<language>fr</language>
|
||||
<lastBuildDate><?= htmlspecialchars($lastBuild) ?></lastBuildDate>
|
||||
|
||||
|
||||
+16
-1
@@ -12,6 +12,7 @@ if (session_status() === PHP_SESSION_NONE) {
|
||||
|
||||
require_once BASE_PATH . '/src/helpers.php';
|
||||
require_once BASE_PATH . '/src/auth.php';
|
||||
require_once BASE_PATH . '/src/SiteSettings.php';
|
||||
require_once BASE_PATH . '/config/config.php';
|
||||
require_once BASE_PATH . '/src/ArticleManager.php';
|
||||
|
||||
@@ -21,7 +22,7 @@ $action = $_GET['action'] ?? 'list';
|
||||
$uuid = $_GET['uuid'] ?? '';
|
||||
$slug = $_GET['slug'] ?? '';
|
||||
|
||||
$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category'];
|
||||
$_noindexActions = ['create', 'edit', 'admin', 'categories', 'diff', 'add_files', 'import_image', 'import_image_step2', 'sources', 'profile', 'delete_file', 'delete_external_link', 'rename_category', 'delete_category', 'toggle_private_category', 'admin_save_site'];
|
||||
$metaRobots = in_array($action, $_noindexActions, true) ? 'noindex, nofollow' : null;
|
||||
unset($_noindexActions);
|
||||
|
||||
@@ -1342,6 +1343,7 @@ switch ($action) {
|
||||
requireAuth();
|
||||
$tab = $_GET['tab'] ?? (isAdmin() ? 'dashboard' : 'articles');
|
||||
$adminData = [];
|
||||
$siteSettingsSaved = isset($_GET['saved']);
|
||||
|
||||
if ($tab === 'dashboard') {
|
||||
if (!isAdmin()) {
|
||||
@@ -1512,6 +1514,19 @@ switch ($action) {
|
||||
header('Location: /admin/users');
|
||||
exit;
|
||||
|
||||
case 'admin_save_site':
|
||||
requireAuth();
|
||||
if (!isAdmin() || $_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
http_response_code(403);
|
||||
exit;
|
||||
}
|
||||
saveSiteSettings([
|
||||
'site_title' => $_POST['site_title'] ?? '',
|
||||
'site_claim' => $_POST['site_claim'] ?? '',
|
||||
]);
|
||||
header('Location: /admin/site?saved=1');
|
||||
exit;
|
||||
|
||||
case 'admin_create_role':
|
||||
requireAuth();
|
||||
if (!isAdmin() || $_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
|
||||
Reference in New Issue
Block a user