change: default extname to "", working for #41

This commit is contained in:
harttle
2017-10-31 00:10:45 +08:00
parent 8241625be4
commit 23e7424f9d
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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.
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`.
+1 -1
View File
@@ -114,7 +114,7 @@ function factory (options) {
options = _.assign({
root: ['.'],
cache: false,
extname: '.liquid',
extname: '',
trim_tag_right: false,
trim_tag_left: false,
trim_value_right: false,
+1 -1
View File
@@ -93,7 +93,7 @@ describe('liquid', function () {
.to.eventually.equal('foo')
})
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))
.to.eventually.equal('bar')
})