feat(reading): clean and refactor routing for books -> reading to separate paths
This commit is contained in:
parent
8d9455940e
commit
2666d6ed67
21 changed files with 51 additions and 89 deletions
|
@ -9,18 +9,12 @@
|
|||
$requestUri = $_SERVER["REQUEST_URI"];
|
||||
$url = trim(parse_url($requestUri, PHP_URL_PATH), "/");
|
||||
|
||||
if (strpos($url, "music/artists/") !== 0) {
|
||||
echo file_get_contents(__DIR__ . "/../../404/index.html");
|
||||
exit();
|
||||
}
|
||||
if (strpos($url, "music/artists/") !== 0) redirectTo404();
|
||||
|
||||
$fetcher = new ArtistFetcher();
|
||||
$artist = $fetcher->fetch($url);
|
||||
|
||||
if (!$artist) {
|
||||
echo file_get_contents(__DIR__ . "/../../404/index.html");
|
||||
exit();
|
||||
}
|
||||
if (!$artist) redirectTo404();
|
||||
|
||||
$artist["description"] = parseMarkdown($artist["description"]);
|
||||
$pageTitle = htmlspecialchars("Artists • " . $artist["name"], ENT_QUOTES, "UTF-8");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue