feat: seo stuff

This commit is contained in:
TheClashFruit 2023-09-18 18:37:58 +02:00
parent a806fc043c
commit 6c4c425524
Signed by: TheClashFruit
GPG key ID: CF4A319B9A73290C
4 changed files with 64 additions and 12 deletions

BIN
img/social_image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

View file

@ -22,30 +22,40 @@
$router->get('/', function() {
global $twig;
$twig->addGlobal('pageUri', '/');
echo $twig->render('index.twig');
});
$router->get('/nations', function() {
global $twig;
$twig->addGlobal('pageUri', '/nations');
echo $twig->render('nations.twig');
});
$router->get('/rules', function() {
global $twig;
$twig->addGlobal('pageUri', '/rules');
echo $twig->render('rules.twig');
});
$router->get('/map', function() {
global $twig;
$twig->addGlobal('pageUri', '/map');
echo $twig->render('map.twig');
});
$router->get('/profile', function() {
global $twig, $mysql;
$twig->addGlobal('pageUri', '/profile');
$user = $mysql->getUserRecordFromId($_SESSION['user']['id']);
@ -60,6 +70,8 @@
$router->get('/u/([a-z0-9_\.]+)', function($name) {
global $twig, $mysql, $discord;
$twig->addGlobal('pageUri', '/u/' . $name);
$user = $mysql->getUserRecordFromUsername($name);
@ -74,6 +86,8 @@
$router->set404(function() {
global $twig;
$twig->addGlobal('pageUri', '404');
http_response_code(404);

View file

@ -6,7 +6,28 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Clyde's Real Survival SMP &bull; {{ pageTitle }}</title>
<meta name="name" content="Clyde's Real Survival SMP &bull; {{ pageTitle }}" />
<meta name="description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
<meta name="keywords" content="crss, minecraft, beta, alpha, release, new, 1.0, version" />
<meta name="theme-color" content="#ffffff" />
<meta property="og:site_name" content="Clyde's Real Survival SMP" />
<meta property="og:title" content="{{ pageTitle }}" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_UK" />
<meta property="og:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
<meta property="og:image" content="https://crss.blurryface.xyz/img/social_image.png" />
<meta property="og:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="crss.blurryface.xyz" />
<meta property="twitter:url" content="https://crss.blurryface.xyz{{ pageUri }}" />
<meta name="twitter:title" content="Clyde's Real Survival SMP &bull; {{ pageTitle }}" />
<meta name="twitter:description" content="A very cool minecraft SMP that updates to every version starting from b1.0." />
<meta name="twitter:image" content="https://crss.blurryface.xyz/img/social_image.png" />
{% if pageTitle == 'Map' %}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>

View file

@ -4,21 +4,38 @@
<a id="homeLink" href="/">Go Home</a>
<script>
let map = L.map('map', {
zoomControl: false,
scrollWheelZoom: false,
doubleClickZoom: false,
}).setView([-36.3, -41.3], 4);
L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
let mapLayer = L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
attribution: '&copy; <a href="https://crss.blurryface.xyz/">CRSS</a> players',
noWrap: true
}).addTo(map);
});
L.marker([-36.3, -41.3])
.addTo(map)
let spawnTown = L.marker([-36.3, -41.3])
.bindPopup('Spawn Town in Republic of Panorama');
let notchTemple = L.marker([-71, -51.8])
.bindPopup('The Temple of Notch (<a href="https://www.planetminecraft.com/project/the-shrine-of-notch/">Original Map</a>)');
let markers = L.layerGroup([
spawnTown,
notchTemple
]);
let map = L.map('map', {
zoomControl: false,
scrollWheelZoom: false,
doubleClickZoom: false,
layers: [mapLayer, markers]
}).setView([-36.3, -41.3], 4);
let baseMaps = {
"Overworld": mapLayer
};
let overlayMaps = {
"Markers": markers
};
let layerControl = L.control.layers(baseMaps, overlayMaps).addTo(map);
</script>
{% include 'includes/foot.twig' %}