mirror of
https://github.com/kataras/iris.git
synced 2025-01-26 03:56:34 +01:00
21 lines
424 B
Go
21 lines
424 B
Go
|
package jade
|
||
|
|
||
|
import (
|
||
|
"github.com/Joker/jade"
|
||
|
"github.com/kataras/iris/config"
|
||
|
"github.com/kataras/iris/render/template/engine/html"
|
||
|
)
|
||
|
|
||
|
type Engine struct {
|
||
|
*html.Engine
|
||
|
}
|
||
|
|
||
|
func New(cfg config.Template) *Engine {
|
||
|
|
||
|
underline := &Engine{Engine: html.New(cfg)}
|
||
|
underline.Middleware = func(relativeName string, fileContents string) (string, error) {
|
||
|
return jade.Parse(relativeName, fileContents)
|
||
|
}
|
||
|
return underline
|
||
|
}
|