diff --git a/include/header.inc b/include/header.inc index 3da277344c..f3889daf7f 100644 --- a/include/header.inc +++ b/include/header.inc @@ -65,7 +65,7 @@ if (!isset($config["languages"])) { "> - PHP: <?php echo $title ?> + <?php echo $title ?> $modified): ?> diff --git a/include/layout.inc b/include/layout.inc index c69d390b32..83efa1c6bb 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -421,12 +421,13 @@ EOT; return $retval; } -function site_header(string $title = 'Hypertext Preprocessor', array $config = []): void +function site_header(?string $title = NULL, array $config = []): void { global $MYSITE, $LANG; + $title = $title ? "PHP: {$title}" : 'PHP'; $meta_image_path = $MYSITE . 'images/meta-image.png'; - $meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; + $meta_description = $config['description'] ?? "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; $defaults = [ "lang" => $LANG, @@ -441,13 +442,13 @@ function site_header(string $title = 'Hypertext Preprocessor', array $config = [ - + - - + + diff --git a/include/shared-manual.inc b/include/shared-manual.inc index eb0437e278..5d10ea5df0 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -325,8 +325,9 @@ function manual_setup($setup): void { "prev" => $setup["prev"], "next" => $setup["next"], "cache" => $lastmod, + "description" => $setup["this"][2] ?? null, ]; - site_header($setup["this"][1] . " - Manual ", $config); + site_header($setup["this"][1] . " - Manual", $config); $languageChooser = manual_language_chooser($config['lang'], $config['thispage']); diff --git a/index.php b/index.php index 5e52b8a57c..9808189f79 100644 --- a/index.php +++ b/index.php @@ -108,7 +108,7 @@ EOF; -site_header("Hypertext Preprocessor", +site_header(NULL, [ 'current' => 'home', 'headtags' => [