coryd.dev/src/includes/dynamic/fetchers/artist.php.liquid

25 lines
672 B
Text

<?php
require_once __DIR__ . '/../../bootstrap.php';
use App\Classes\ArtistFetcher;
$requestUri = $_SERVER["REQUEST_URI"];
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
if (strpos($url, "music/artists/") !== 0) redirectTo404();
$fetcher = new ArtistFetcher();
$artist = $fetcher->fetch($url);
if (!$artist) redirectTo404();
$artist["description_html"] = parseMarkdown($artist["description"]);
$artist["globals"] = $fetcher->getGlobals();
$page = $artist;
extract(setupPageMetadata($page, $requestUri));
header("Cache-Control: public, max-age=3600");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600) . " GMT");
?>