refactor: ♻️ clean up unused Twig templates

This commit is contained in:
David Bailey 2023-12-11 22:52:30 +01:00
parent d54d3077cb
commit a7a7c738ec
12 changed files with 253 additions and 98 deletions

View file

@ -68,33 +68,23 @@ if($SURI == '/') {
exit(0);
}
echo $twig->render('directory.html', [
echo $twig->render('post_types/directory.html', [
"post" => $post,
"subposts" => $post['subposts']
]);
}
elseif($post['post_metadata']['type'] == 'text/markdown') {
echo $twig->render('about.html', [
echo $twig->render('post_types/markdown.html', [
"post" => $post,
"subposts" => $post['subposts']
]);
}
elseif($post['post_metadata']['type'] == 'file') {
echo $twig->render('image.html', [
echo $twig->render('post_types/image.html', [
"post" => $post
]);
}
} elseif(preg_match('/^\/about(.html)?$/', $SURI)) {
echo $twig->render('about.html');
} elseif(preg_match('/^\/gallery\/([^\?]+)/', $SURI)) {
echo $twig->render('/gallery/gallery_entry.html', [
'image_url' => '/static/banner/0.png',
'image_title' => 'Test!',
'image_desc' => 'A soft piece made by a dear friend',
'artist_name' => 'Doggonaut',
'artist_src_link' => 'https://twitter.com/doggonaut'
]);
} else {
echo $twig->render('rrror.html',[
"error_code" => '404 Hoard not found!',