d70460e68c
This commit calls `filepath.EvalSymlinks` before `filepath.Walk` in the initialization of the template file system in order to allow it to be a symlink. Otherwise `filepath.Walk` would just yield the symlink itself, resulting in undefined templates. This does not allow to use symlinks **inside** the template directory. The error handling changes may look odd at first sight but it behaves as before; previously if `opt.Directory` was not an existing file, `filepath.Walk` would call the callback with the same unexisting directory as `path` plus an error (the error being ignored). `filepath.Rel` would not error on this, and the rest of the function would just do nothing provided that the unexisting directory does not have a known extension. Now in case of an error with `filepath.EvalSymlinks`, the rest of the function is just skipped (and as a side effect preventing potential errors when the unexisting directory have a known extension). |
||
---|---|---|
.. | ||
basic | ||
basic2 | ||
custom_funcs | ||
symlink |