feature: Switch to twig for template engine
This commit is contained in:
Keith Solomon
2025-05-23 06:41:48 -05:00
parent 5e327b9b59
commit 54de77e544
11 changed files with 86 additions and 432 deletions

View File

@@ -1,6 +0,0 @@
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}

7
views/error.twig Normal file
View File

@@ -0,0 +1,7 @@
{% extends 'layout.twig' %}
{% block body %}
<h1>{{message}}</h1>
<h2>{{error.status}}</h2>
<pre>{{error.stack}}</pre>
{% endblock %}

View File

@@ -1,8 +0,0 @@
extends layout
block content
h1= title
p Welcome to #{title}
hr
h2= title2
p Welcome to the Express Generator Skeleton!

6
views/index.twig Normal file
View File

@@ -0,0 +1,6 @@
{% extends 'layout.twig' %}
{% block body %}
<h1>{{title}}</h1>
<p>Welcome to {{title}}</p>
{% endblock %}

View File

@@ -1,7 +0,0 @@
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content

10
views/layout.twig Normal file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>-