【文件属性】:
文件名称:mustache:模板渲染
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-07 18:56:52
JavaScript
小胡子模板渲染
如何在Alosaur中使用渲染器
import { renderFile } from 'https://deno.land/x/mustache/mod.ts' ;
app . useViewRender ( {
type : 'mustache' ,
basePath : ` ${ Deno . cwd ( ) } /views/` , // path to folder views
getBody : ( path : string , model : Object , config : ViewRenderConfig ) =>
renderFile ( normalize ( ` ${ config . basePath } ${ path } .html` ) , model ) ,
} ) ;
【文件预览】:
mustache-master
----mod.ts(378B)
----mustache.mjs(23KB)
----.github()
--------workflows()
----tests()
--------index.html(25B)
--------basic.test.ts(362B)
----README.md(517B)