mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-29 07:05:13 -07:00
docs for #41
This commit is contained in:
@@ -82,7 +82,7 @@ The full list of options for `Liquid()` is listed as following:
|
|||||||
If an array, the files are looked up in the order they occur in the array.
|
If an array, the files are looked up in the order they occur in the array.
|
||||||
Defaults to `["."]`
|
Defaults to `["."]`
|
||||||
|
|
||||||
* `extname` is used to lookup the template file when filepath doesn't include an extension name. Defaults to `".liquid"`
|
* `extname` is used to lookup the template file when filepath doesn't include an extension name. Set to `""` if you do **NOT** want liquidjs to append default extname. Defaults to `".liquid"`.
|
||||||
|
|
||||||
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
|
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ describe('liquid', function () {
|
|||||||
strict_filters: true
|
strict_filters: true
|
||||||
})
|
})
|
||||||
mock({
|
mock({
|
||||||
|
'/root/files/bar': 'bar',
|
||||||
'/root/files/foo.html': 'foo',
|
'/root/files/foo.html': 'foo',
|
||||||
'/root/files/name.html': 'My name is {{name}}.',
|
'/root/files/name.html': 'My name is {{name}}.',
|
||||||
'/un-readable.html': mock.file({
|
'/un-readable.html': mock.file({
|
||||||
@@ -91,6 +92,11 @@ describe('liquid', function () {
|
|||||||
return expect(engine.renderFile('/root/files/foo.html', ctx))
|
return expect(engine.renderFile('/root/files/foo.html', ctx))
|
||||||
.to.eventually.equal('foo')
|
.to.eventually.equal('foo')
|
||||||
})
|
})
|
||||||
|
it('should find files without extname', function () {
|
||||||
|
var engine = Liquid({root: '/root', extname: ''})
|
||||||
|
return expect(engine.renderFile('/root/files/bar', ctx))
|
||||||
|
.to.eventually.equal('bar')
|
||||||
|
})
|
||||||
it('should accept relative path', function () {
|
it('should accept relative path', function () {
|
||||||
return expect(engine.renderFile('files/foo.html'))
|
return expect(engine.renderFile('files/foo.html'))
|
||||||
.to.eventually.equal('foo')
|
.to.eventually.equal('foo')
|
||||||
|
|||||||
Reference in New Issue
Block a user