Made a template
This commit is contained in:
parent
3422a072e6
commit
80786d4a2b
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "Hyperlink-Redirect",
|
"name": "Hyperlink-Redirect",
|
||||||
"depends": ["Humming-Bird"],
|
"depends": [
|
||||||
|
"Humming-Bird",
|
||||||
|
"Template6"
|
||||||
|
],
|
||||||
"provides": {
|
"provides": {
|
||||||
"Hyperlink-Redirect": "lib/Hyperlink-Redirect.rakumod"
|
"Hyperlink-Redirect": "lib/Hyperlink-Redirect.rakumod"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
use v6.d;
|
use v6.d;
|
||||||
|
|
||||||
use Humming-Bird::Core;
|
use Humming-Bird::Core;
|
||||||
|
use Template6;
|
||||||
|
|
||||||
# Normally would 'use' local libs here for Controller and Model and
|
# Normally would 'use' local libs here for Controller and Model and
|
||||||
# what not but keeping it simple for now...
|
# what not but keeping it simple for now...
|
||||||
|
|
||||||
|
# Where art thou templates
|
||||||
|
my $templates = Template6.new;
|
||||||
|
$templates.add-path: 'templates';
|
||||||
|
|
||||||
# Must set the root path lest yet miss setting $!root
|
# Must set the root path lest yet miss setting $!root
|
||||||
my $router = Router.new(root => '/');
|
my $router = Router.new(root => '/');
|
||||||
|
|
||||||
$router.get(-> $request, $response {
|
$router.get(-> $request, $response {
|
||||||
$response.write('testing 123...')
|
$response.html($templates.process: 'index');
|
||||||
});
|
});
|
||||||
|
|
10
templates/index.tt
Normal file
10
templates/index.tt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Test page</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Ayy...</h1>
|
||||||
|
<p>lmao</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue