-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The demo is located at demo/typescript/index.ts , working on #98
- Loading branch information
Showing
7 changed files
with
2,300 additions
and
2,292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ build/ | |
|
||
# editors | ||
.*.swp | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const Liquid = require('../..') | ||
const Liquid = require('liquidjs') | ||
|
||
const engine = new Liquid({ | ||
root: __dirname, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Liquid, {isTruthy} from 'liquidjs' | ||
|
||
const engine = new Liquid({ | ||
root: __dirname, | ||
extname: '.liquid' | ||
}) | ||
const ctx = { | ||
todos: ['fork and clone', 'make it better', 'make a pull request'], | ||
title: 'Welcome to liquidjs!' | ||
} | ||
|
||
// console.log('isTruthy:', isTruthy('a string here')); | ||
engine.renderFile('todolist', ctx).then(console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ul> | ||
{% for todo in todos %} | ||
<li>{{forloop.index}} - {{todo}}</li> | ||
{% endfor %} | ||
</ul> |
Oops, something went wrong.