Init
This commit is contained in:
10
rss/php/includes/footer.php
Normal file
10
rss/php/includes/footer.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
global $pageInfo;
|
||||
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/rss/js/' . $pageInfo['template'] . '.js')) {
|
||||
echo '<script src="/rss/js/' . $pageInfo['template'] . '.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
<footer>
|
||||
|
||||
</footer>
|
||||
77
rss/php/includes/header.php
Normal file
77
rss/php/includes/header.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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' => 'ECUSM',
|
||||
'long_desc' => '',
|
||||
'robots' => 'noindex, nofollow'
|
||||
];
|
||||
|
||||
// Set default values
|
||||
$siteUrl = 'http://ecusm.local';
|
||||
$pageUrl = $page === 'index' ? $siteUrl . '/' : $siteUrl . '/' . $page . '/';
|
||||
$title = $pageData['title'] ?? 'ECUSM';
|
||||
$description = $pageData['long_desc'] ?? '';
|
||||
$keywords = '';
|
||||
$robots = $pageData['robots'] ?? 'noindex, nofollow';
|
||||
$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>ECUSM | <?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="ECUSM">
|
||||
<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; ?>/rss/img/image.png">
|
||||
|
||||
<!-- 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; ?>/rss/img/image.png">
|
||||
|
||||
<!-- 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">
|
||||
|
||||
<!-- 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": "ECUSM",
|
||||
"url": "<?php echo $siteUrl; ?>/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
||||
</header>
|
||||
Reference in New Issue
Block a user