mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -04:00
Don't output OG header data for 404 pages
This commit is contained in:
parent
1be895212c
commit
f1352ec215
2 changed files with 4 additions and 1 deletions
|
@ -8,6 +8,7 @@ $colorScheme = $_COOKIE['color-scheme'] ?? 'auto';
|
||||||
$xmlDeclaration = $xmlDeclaration ?? true;
|
$xmlDeclaration = $xmlDeclaration ?? true;
|
||||||
$feedUrl = $feedUrl ?? null;
|
$feedUrl = $feedUrl ?? null;
|
||||||
$feedTitle = $feedTitle ?? '';
|
$feedTitle = $feedTitle ?? '';
|
||||||
|
$is404 = $is404 ?? false;
|
||||||
|
|
||||||
if($xmlDeclaration){
|
if($xmlDeclaration){
|
||||||
header('content-type: application/xhtml+xml; charset=utf-8');
|
header('content-type: application/xhtml+xml; charset=utf-8');
|
||||||
|
@ -53,6 +54,7 @@ if($xmlDeclaration){
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<link rel="search" href="/ebooks" type="application/xhtml+xml; charset=utf-8"/>
|
<link rel="search" href="/ebooks" type="application/xhtml+xml; charset=utf-8"/>
|
||||||
<link rel="search" href="/ebooks/opensearch" type="application/opensearchdescription+xml; charset=utf-8"/>
|
<link rel="search" href="/ebooks/opensearch" type="application/opensearchdescription+xml; charset=utf-8"/>
|
||||||
|
<? if(!$is404){ ?>
|
||||||
<meta content="#394451" name="theme-color"/>
|
<meta content="#394451" name="theme-color"/>
|
||||||
<meta content="<? if($title != ''){ ?><?= Formatter::ToPlainText($title) ?><? }else{ ?>Standard Ebooks<? } ?>" property="og:title"/>
|
<meta content="<? if($title != ''){ ?><?= Formatter::ToPlainText($title) ?><? }else{ ?>Standard Ebooks<? } ?>" property="og:title"/>
|
||||||
<meta content="<?= $ogType ?? 'website' ?>" property="og:type"/>
|
<meta content="<?= $ogType ?? 'website' ?>" property="og:type"/>
|
||||||
|
@ -61,6 +63,7 @@ if($xmlDeclaration){
|
||||||
<meta content="summary_large_image" name="twitter:card"/>
|
<meta content="summary_large_image" name="twitter:card"/>
|
||||||
<meta content="@standardebooks" name="twitter:site"/>
|
<meta content="@standardebooks" name="twitter:site"/>
|
||||||
<meta content="@standardebooks" name="twitter:creator"/>
|
<meta content="@standardebooks" name="twitter:creator"/>
|
||||||
|
<? } ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?
|
<?
|
||||||
require_once('Core.php');
|
require_once('Core.php');
|
||||||
|
|
||||||
?><?= Template::Header(['title' => 'We Couldn’t Find That Document', 'highlight' => '', 'description' => 'We couldn’t find that document.']) ?>
|
?><?= Template::Header(['title' => 'We Couldn’t Find That Document', 'highlight' => '', 'description' => 'We couldn’t find that document.', 'is404' => true]) ?>
|
||||||
<main>
|
<main>
|
||||||
<section class="narrow has-hero">
|
<section class="narrow has-hero">
|
||||||
<hgroup>
|
<hgroup>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue