-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (28 loc) · 897 Bytes
/
index.js
File metadata and controls
30 lines (28 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var { Liquid } = require('liquidjs');
var engine = new Liquid();
var template = `
<head>
<meta property="translations_normal" content="{{- 'general.test.test_item_normal' | t -}}">
<meta property="translations_nested" content="{{- 'general.test.test_item_nested' | t -}}">
<meta property="asset_url" content="{{- 'thumbnail.jpg' | asset_url -}}">
<meta property="money" content="{{ testAmount | money }}">
{{ 'main.min.css' | asset_url | stylesheet_tag }}
{{ 'main.js' | asset_url | script_tag }}
<script id="handleize">console.log('{{- 'This is a handleized string!' | handleize -}}')</script>
<script id="json">{{ testObj | json }}</script>
</head>
<body>
</body>
`
var data = {
testObj: {
testKey: "testValue"
},
testAmount: 99.99,
paginate: {
pages: 1
},
name: "Joe"
}
require('./filters')(engine)
engine.parseAndRender(template, data).then(console.log);