wings
A simple and very fast template engine for small projects.
Example
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>~(example)~</h1>
<h2>~(func)~</h2>
<h2>~(date)~</h2>
~(component:components/footer.html)~
</body>
</html>
footer.html in components folder.
<footer>Footer</footer>
Server (with ABC framework):
import { Application } from 'https://deno.land/x/abc/mod.ts'
import { render } from 'https://deno.land/x/wings/mod.ts'
const app = new Application()
const add = (a: number, b: number): number => {
return a + b
}
app.get('/', async () => {
return await render('./example/index.html', {
example: '~(Wings)~',
func: add(28, 12),
date: new Date()
})
})
app.start({
port: 1993
})