Contruct a basic view template and layout

This commit is contained in:
swagg boi 2022-07-28 20:44:47 -04:00
parent 2026dfff7a
commit 98a44773d5
3 changed files with 19 additions and 2 deletions

View file

@ -5,8 +5,11 @@
use Mojolicious::Lite -signatures;
get '/', sub ($c) {
$c->render(text => 'ayy... lmao')
# Root redirect
get '/', sub ($c) { $c->redirect_to('view') };
get '/view', sub ($c) {
$c->render()
};
app->start();

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Post::Text - <%= title %></title>
</head>
<body>
<h1>Post::Text</h1>
<%= content %>
</body>
</html>

4
templates/view.html.ep Normal file
View file

@ -0,0 +1,4 @@
% layout 'main';
% title 'View Threads';
<h2><%= title %></h2>
<p>Some threads here...</p>