Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alosaur/mustache

Template render
https://github.com/alosaur/mustache

Last synced: 3 months ago
JSON representation

Template render

Awesome Lists containing this project

README

        

## Mustache template render

[mustache.js](https://github.com/janl/mustache.js)

![test](https://github.com/alosaur/mustache/workflows/test/badge.svg)

### How to use renderer in Alosaur

```ts
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),
});
```