]> Devi Nivas Git - chevron.git/commitdiff
Supporting Partial File Without File Extension
authorJon <31494475+jonioni@users.noreply.github.com>
Fri, 21 Sep 2018 05:04:48 +0000 (01:04 -0400)
committerGitHub <noreply@github.com>
Fri, 21 Sep 2018 05:04:48 +0000 (01:04 -0400)
Change made to function `_get_partial_ext`:
From `path = partials_path + '/' + name + '.' + partials_ext` to `path = partials_path + '/' + name + ('.' + partials_ext if partials_ext else '')`.

chevron/renderer.py

index 3c284d116aa8ce69ebf207c50fbd5ca21dc683d8..c6b19e90b9a81b880fb34c6653d7343d87e3ca19 100644 (file)
@@ -90,7 +90,7 @@ def _get_partial(name, partials_dict, partials_path, partials_ext):
         # Nope...
         try:
             # Maybe it's in the file system
-            path = partials_path + '/' + name + '.' + partials_ext
+            path = partials_path + '/' + name + ('.' + partials_ext if partials_ext else '')
             with open(path, 'r') as partial:
                 return partial.read()