Solid.LocalFileSystem (solid v0.15.2) View Source

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:

file_system = Solid.LocalFileSystem.new("/some/path")

Solid.LocalFileSystem.full_path(file_system, "mypartial")
# => "/some/path/_mypartial.liquid"

Solid.LocalFileSystem.full_path(file_system,"dir/mypartial")
# => "/some/path/dir/_mypartial.liquid"

Optionally in the second argument you can specify a custom pattern for template filenames. %s will be replaced with template basename Default pattern is "_%s.liquid".

Example:

file_system = Solid.LocalFileSystem.new("/some/path", "%s.html")

Solid.LocalFileSystem.full_path( "index", file_system)
# => "/some/path/index.html"

Link to this section Summary

Link to this section Functions

Link to this function

full_path(template_path, file_system)

View Source
Link to this function

new(root, pattern \\ "_%s.liquid")

View Source