This commit is contained in:
Bruno Rybársky 2024-02-15 10:09:01 +01:00
parent 64076f11df
commit a493f322e6
3 changed files with 43 additions and 0 deletions

@ -25,6 +25,13 @@
'default_secret' => 1,
'default_permissions' => 255,
],
'seo' => [
'author' => 'Tím AdlerkaTop',
'description' => 'Toto je neoficiánla študentská stránka pre Adlerku, kde môžete nájsť plno zaujímavostí.',
'keywords' => 'adlerka, alderka, studenti, studentska stranka, web, dev, webdev, web dev, skola, zabava',
'generator' => 'TurboRoute',
'robots' => 'follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large'
]
];
}

@ -157,12 +157,47 @@ function getPage($site_name_in = null, $page_name_in = null): string
$navigation = generateNavigation();
$seo = array();
if(!empty($pageMetadata["parameters"]["author"])){
$seo["author"] = htmlspecialchars($pageMetadata["parameters"]["author"]);
}
else{
$seo["author"] = $routerConfig["seo"]["author"];
}
if(!empty($pageMetadata["parameters"]["description"])){
$seo["description"] = htmlspecialchars($pageMetadata["parameters"]["description"]);
}
else{
$seo["description"] = $routerConfig["seo"]["description"];
}
if(!empty($pageMetadata["parameters"]["keywords"])){
$seo["keywords"] = $routerConfig["seo"]["keywords"] . ", " . htmlspecialchars($pageMetadata["parameters"]["keywords"]);
}
else{
$seo["keywords"] = $routerConfig["seo"]["keywords"];
}
$seo["generator"] = $routerConfig["seo"]["generator"];
$seo["robots"] = $routerConfig["seo"]["robots"];
$seo_stuff = "";
foreach ($seo as $key => $value){
$seo_stuff .= "<meta name='$key' content='$value'>\n";
}
$out = $skeleton;
$out = str_replace("__TEMPLATE__NAV__", $navigation, $out);
$out = str_replace("__TEMPLATE__PAGE__", $page, $out);
$out = str_replace("__TEMPLATE__FOOTER__", $footer, $out);
$out = str_replace("__TEMPLATE__DYNAMIC__SCRIPT__", $dynamic_script, $out);
$out = str_replace("__TEMPLATE__DYNAMIC__STYLE__", $dynamic_style, $out);
$out = str_replace("__TEMPLATE_SEO_STUFF__", $seo_stuff, $out);
if($routerConfig["inlining"]) {
require_once "lib/inliner.php";
$out = inlineLocalStylesFromHref($out);

@ -11,6 +11,7 @@
<script async src="https://umami.brn.systems/script.js" data-website-id="95e93885-5c19-4cab-ba9b-2f746a316a2a"></script>
<script async src="/assets/script.js"></script>
<title>Adlerka __TEMPLATE_PAGE_TITLE__</title>
__TEMPLATE_SEO_STUFF__
</head>
<body>
<div id="navbar_container">