View Source Liquex.LocalFileSystem (liquex v0.13.1)
This implements an abstract file system which retrieves template files named in a manner similar to liquid, ie. with the template name prefixed with an underscore. The extension ".liquid" is also added.
For security reasons, template paths are only allowed to contain letters, numbers, and underscore.
Example:
iex> file_system = Liquex.LocalFileSystem.new("/some/path") iex> Liquex.LocalFileSystem.full_path(file_system, "mypartial") "/some/path/_mypartial.liquid"
Optionally in the second argument you can specify a custom pattern for template filenames. %s is replaced with the template name. Default pattern is "_%s.liquid".
Example:
iex> file_system = Liquex.LocalFileSystem.new("/some/path", "%s.html") iex> Liquex.LocalFileSystem.full_path(file_system, "mypartial") "/some/path/mypartial.html"