mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
29 lines
560 B
HTML
29 lines
560 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<script src="../../dist/liquid.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<h2 id="header"></h2>
|
|
<script>
|
|
var engine = window.Liquid();
|
|
|
|
var src = 'Welcome to {{ name | capitalize}}, ' +
|
|
'access time: {{date|date: "%Y-%m-%d %H:%M:%S"}}';
|
|
var ctx = {
|
|
name: 'Liquid',
|
|
date: new Date()
|
|
};
|
|
engine.parseAndRender(src, ctx)
|
|
.then(function(html) {
|
|
document.getElementById('header').innerHTML = html;
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|