mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-02 16:45:14 -07:00
change: default extname to "", working 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. Set to `""` if you do **NOT** want liquidjs to append default extname. Defaults to `".liquid"`.
|
* `extname` is used to lookup the template file when filepath doesn't include an extension name. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`.
|
||||||
|
|
||||||
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
|
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ function factory (options) {
|
|||||||
options = _.assign({
|
options = _.assign({
|
||||||
root: ['.'],
|
root: ['.'],
|
||||||
cache: false,
|
cache: false,
|
||||||
extname: '.liquid',
|
extname: '',
|
||||||
trim_tag_right: false,
|
trim_tag_right: false,
|
||||||
trim_tag_left: false,
|
trim_tag_left: false,
|
||||||
trim_value_right: false,
|
trim_value_right: false,
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ describe('liquid', function () {
|
|||||||
.to.eventually.equal('foo')
|
.to.eventually.equal('foo')
|
||||||
})
|
})
|
||||||
it('should find files without extname', function () {
|
it('should find files without extname', function () {
|
||||||
var engine = Liquid({root: '/root', extname: ''})
|
var engine = Liquid({root: '/root'})
|
||||||
return expect(engine.renderFile('/root/files/bar', ctx))
|
return expect(engine.renderFile('/root/files/bar', ctx))
|
||||||
.to.eventually.equal('bar')
|
.to.eventually.equal('bar')
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user