forked from CRSS/Website
feat: seo stuff
This commit is contained in:
parent
a806fc043c
commit
6c4c425524
BIN
img/social_image.png
Normal file
BIN
img/social_image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 720 KiB |
14
index.php
14
index.php
|
@ -23,30 +23,40 @@
|
||||||
$router->get('/', function() {
|
$router->get('/', function() {
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/');
|
||||||
|
|
||||||
echo $twig->render('index.twig');
|
echo $twig->render('index.twig');
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/nations', function() {
|
$router->get('/nations', function() {
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/nations');
|
||||||
|
|
||||||
echo $twig->render('nations.twig');
|
echo $twig->render('nations.twig');
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/rules', function() {
|
$router->get('/rules', function() {
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/rules');
|
||||||
|
|
||||||
echo $twig->render('rules.twig');
|
echo $twig->render('rules.twig');
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/map', function() {
|
$router->get('/map', function() {
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/map');
|
||||||
|
|
||||||
echo $twig->render('map.twig');
|
echo $twig->render('map.twig');
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->get('/profile', function() {
|
$router->get('/profile', function() {
|
||||||
global $twig, $mysql;
|
global $twig, $mysql;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/profile');
|
||||||
|
|
||||||
$user = $mysql->getUserRecordFromId($_SESSION['user']['id']);
|
$user = $mysql->getUserRecordFromId($_SESSION['user']['id']);
|
||||||
|
|
||||||
if($user == null) {
|
if($user == null) {
|
||||||
|
@ -61,6 +71,8 @@
|
||||||
$router->get('/u/([a-z0-9_\.]+)', function($name) {
|
$router->get('/u/([a-z0-9_\.]+)', function($name) {
|
||||||
global $twig, $mysql, $discord;
|
global $twig, $mysql, $discord;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '/u/' . $name);
|
||||||
|
|
||||||
$user = $mysql->getUserRecordFromUsername($name);
|
$user = $mysql->getUserRecordFromUsername($name);
|
||||||
|
|
||||||
if($user == null) {
|
if($user == null) {
|
||||||
|
@ -75,6 +87,8 @@
|
||||||
$router->set404(function() {
|
$router->set404(function() {
|
||||||
global $twig;
|
global $twig;
|
||||||
|
|
||||||
|
$twig->addGlobal('pageUri', '404');
|
||||||
|
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
|
|
||||||
echo $twig->render('404.twig');
|
echo $twig->render('404.twig');
|
||||||
|
|
|
@ -7,6 +7,27 @@
|
||||||
|
|
||||||
<title>Clyde's Real Survival SMP • {{ pageTitle }}</title>
|
<title>Clyde's Real Survival SMP • {{ pageTitle }}</title>
|
||||||
|
|
||||||
|
<meta name="name" content="Clyde's Real Survival SMP • {{ 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 • {{ 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' %}
|
{% if pageTitle == 'Map' %}
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/>
|
<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>
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
|
|
|
@ -4,21 +4,38 @@
|
||||||
<a id="homeLink" href="/">Go Home</a>
|
<a id="homeLink" href="/">Go Home</a>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
let mapLayer = L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
|
||||||
|
attribution: '© <a href="https://crss.blurryface.xyz/">CRSS</a> players',
|
||||||
|
noWrap: true
|
||||||
|
});
|
||||||
|
|
||||||
|
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', {
|
let map = L.map('map', {
|
||||||
zoomControl: false,
|
zoomControl: false,
|
||||||
scrollWheelZoom: false,
|
scrollWheelZoom: false,
|
||||||
doubleClickZoom: false,
|
doubleClickZoom: false,
|
||||||
|
layers: [mapLayer, markers]
|
||||||
}).setView([-36.3, -41.3], 4);
|
}).setView([-36.3, -41.3], 4);
|
||||||
|
|
||||||
L.tileLayer('https://cdn.theclashfruit.me/crss/map/tile_{x}x{y}y.png', {
|
let baseMaps = {
|
||||||
attribution: '© <a href="https://crss.blurryface.xyz/">CRSS</a> players',
|
"Overworld": mapLayer
|
||||||
noWrap: true
|
};
|
||||||
}).addTo(map);
|
|
||||||
|
|
||||||
|
let overlayMaps = {
|
||||||
|
"Markers": markers
|
||||||
|
};
|
||||||
|
|
||||||
L.marker([-36.3, -41.3])
|
let layerControl = L.control.layers(baseMaps, overlayMaps).addTo(map);
|
||||||
.addTo(map)
|
|
||||||
.bindPopup('Spawn Town in Republic of Panorama');
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include 'includes/foot.twig' %}
|
{% include 'includes/foot.twig' %}
|
Loading…
Reference in a new issue