merma
✨feature: Switch to twig for template engine
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
h1= message
|
||||
h2= error.status
|
||||
pre #{error.stack}
|
||||
7
views/error.twig
Normal file
7
views/error.twig
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>{{message}}</h1>
|
||||
<h2>{{error.status}}</h2>
|
||||
<pre>{{error.stack}}</pre>
|
||||
{% endblock %}
|
||||
@@ -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
6
views/index.twig
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>{{title}}</h1>
|
||||
<p>Welcome to {{title}}</p>
|
||||
{% endblock %}
|
||||
@@ -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
10
views/layout.twig
Normal 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>-
|
||||
Reference in New Issue
Block a user