79 lines
3.3 KiB
PHP
79 lines
3.3 KiB
PHP
<?php
|
|
$page = isset($_GET['page']) ? basename($_GET['page']) : 'index';
|
|
$jsonFile = $_SERVER['DOCUMENT_ROOT'] . "/rss/json/pages/{$page}.json";
|
|
$pageData = file_exists($jsonFile) ? json_decode(file_get_contents($jsonFile), true) : [
|
|
'title' => 'SITE',
|
|
'long_desc' => '',
|
|
'robots' => 'index, follow'
|
|
];
|
|
|
|
// Set default values
|
|
$siteUrl = 'https://DOMAIN.com';
|
|
$pageUrl = $page === 'index' ? $siteUrl . '/' : $siteUrl . '/' . $page . '/';
|
|
$title = $pageData['title'] ?? 'SITE';
|
|
$description = $pageData['long_desc'] ?? '';
|
|
$keywords = '';
|
|
$robots = $pageData['robots'] ?? 'index, follow';
|
|
|
|
$currentPage = $page === 'index' ? 'Home' : ucwords(str_replace('-', ' ', $page));
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Defaults -->
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>WEBSITE | <?php echo htmlspecialchars($pageData['title'], ENT_QUOTES, 'UTF-8'); ?></title>
|
|
<meta name="description" content="<?php echo htmlspecialchars($description, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta name="author" content="WEBSITE">
|
|
<meta name="keywords" content="<?php echo htmlspecialchars($keywords, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta name="robots" content="<?php echo htmlspecialchars($robots, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<link rel="canonical" href="<?php echo htmlspecialchars($pageUrl, ENT_QUOTES, 'UTF-8'); ?>">
|
|
|
|
<!-- Open Graph -->
|
|
<meta property="og:title" content="<?php echo htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta property="og:description" content="<?php echo htmlspecialchars($description, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:url" content="<?php echo htmlspecialchars($pageUrl, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta property="og:image" content="<?php echo $siteUrl; ?>/IMAGE">
|
|
|
|
<!-- Twitter Card -->
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:title" content="<?php echo htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta name="twitter:description" content="<?php echo htmlspecialchars($description, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<meta name="twitter:image" content="<?php echo $siteUrl; ?>/IMAGE">
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" href="/rss/img/favicon/favicon.ico" type="image/x-icon">
|
|
<link rel="apple-touch-icon" href="/rss/img/favicon/apple-touch-icon.png">
|
|
|
|
<!-- Stylesheets -->
|
|
<link rel="preload" href="/rss/css/main.css" as="style">
|
|
<link href="https://cdn.jsdelivr.net/npm/@mdi/font/css/materialdesignicons.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="/rss/css/main.css">
|
|
<link rel="stylesheet" href="/rss/css/theme.css" media="print" onload="this.media='all'">
|
|
|
|
<!-- JavaScript -->
|
|
<script src="/rss/js/main.js" defer></script>
|
|
|
|
<!-- Structured Data (JSON-LD) -->
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "WebPage",
|
|
"name": "<?php echo htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); ?>",
|
|
"url": "<?php echo htmlspecialchars($pageUrl, ENT_QUOTES, 'UTF-8'); ?>",
|
|
"description": "<?php echo htmlspecialchars($description, ENT_QUOTES, 'UTF-8'); ?>",
|
|
"isPartOf": {
|
|
"@type": "WebSite",
|
|
"name": "SITE NAME",
|
|
"url": "<?php echo $siteUrl; ?>/"
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<header>
|
|
|
|
</header>
|