Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/header.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if (!isset($config["languages"])) {
<base href="<?php echo $_SERVER["BASE_HREF"]; ?>">
<?php endif ?>

<title>PHP: <?php echo $title ?></title>
<title><?php echo $title ?></title>

<?php foreach($CSS as $filename => $modified): ?>
<link rel="stylesheet" type="text/css" href="/cached.php?t=<?php echo $modified?>&amp;f=<?php echo $filename?>" media="screen">
Expand Down
11 changes: 6 additions & 5 deletions include/layout.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -441,13 +442,13 @@ function site_header(string $title = 'Hypertext Preprocessor', array $config = [

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@official_php" />
<meta name="twitter:title" content="PHP: Hypertext Preprocessor" />
<meta name="twitter:title" content="{$title}" />
<meta name="twitter:description" content="{$meta_description}" />
<meta name="twitter:creator" content="@official_php" />
<meta name="twitter:image:src" content="{$meta_image_path}" />

<meta itemprop="name" content="PHP: Hypertext Preprocessor" />
<meta itemprop="description" content="$meta_description" />
<meta itemprop="name" content="{$title}" />
<meta itemprop="description" content="{$meta_description}" />
<meta itemprop="image" content="{$meta_image_path}" />

<meta property="og:image" content="{$meta_image_path}" />
Expand Down
3 changes: 2 additions & 1 deletion include/shared-manual.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</div>
EOF;

site_header("Hypertext Preprocessor",
site_header(NULL,
[
'current' => 'home',
'headtags' => [
Expand Down