From 98a44773d5a15c5145f895243c1bcec46bf5bd27 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Thu, 28 Jul 2022 20:44:47 -0400 Subject: [PATCH] Contruct a basic view template and layout --- PostText.pl | 7 +++++-- templates/layouts/main.html.ep | 10 ++++++++++ templates/view.html.ep | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 templates/view.html.ep diff --git a/PostText.pl b/PostText.pl index 6f9d19c..3cedec3 100755 --- a/PostText.pl +++ b/PostText.pl @@ -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(); diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep index e69de29..9f3061e 100644 --- a/templates/layouts/main.html.ep +++ b/templates/layouts/main.html.ep @@ -0,0 +1,10 @@ + + + + Post::Text - <%= title %> + + +

Post::Text

+<%= content %> + + diff --git a/templates/view.html.ep b/templates/view.html.ep new file mode 100644 index 0000000..069175b --- /dev/null +++ b/templates/view.html.ep @@ -0,0 +1,4 @@ +% layout 'main'; +% title 'View Threads'; +

<%= title %>

+

Some threads here...