From 51fbcf803ee055cabebd8e81486542cbcd2c4b0d Mon Sep 17 00:00:00 2001 From: Miraty Date: Tue, 30 May 2023 22:57:39 +0200 Subject: [PATCH] Make some configs optional --- mkht.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mkht.php b/mkht.php index 5705b15..7b94737 100755 --- a/mkht.php +++ b/mkht.php @@ -34,7 +34,7 @@ if (file_exists(SITE . '/config.ini')) $config['title'] ??= ''; $config['css'] ??= 1; $config['header'] ??= false; -$config['author'] ??= ''; +$config['author'] ??= NULL; $config['base-url'] ??= []; $config['center-index'] ??= false; $config['default-lang'] ??= NULL; @@ -100,7 +100,7 @@ foreach ($config['base-url'] as $url) ?> - + $last_mod) { ?> - '; + if ($config['announce-feed']) echo '' . LF; @@ -273,7 +275,7 @@ foreach ($files_dates as $src_page => $last_mod) { global $config; global $path_parts; - return ' href="' . $config['base-url'][0] . substr($path_parts['dirname'], strlen(SITE)) . '/' . $matches['relative_url'] . '"'; + return ' href="' . ($config['base-url'][0] ?? '') . substr($path_parts['dirname'], strlen(SITE)) . '/' . $matches['relative_url'] . '"'; }, $atom_entry_content); if (!in_array('draft', explode('.', $path_parts['basename']), true)) {