wings

Template engine for Deno projects.

Example

Client:

<!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>

Server (with ABC framework):

import { Application } from 'https://deno.land/x/abc/mod.ts'
import { Wings } from 'https://deno.land/x/wings/mod.ts'

const app = new Application()
const wings = new Wings()

const add = (a: number, b: number): number => {
    return a + b
}

app.get('/', async () => {
    return await wings.render('./static/index.html', {
        example: '~(Wings)~',
        func: add(28, 12),
        date: new Date()
    })
})

app.start({ port: 8080 })