Solid.FileSystem behaviour (solid v0.15.2) View Source

A Solid file system is a way to let your templates retrieve other templates for use with the include tag.

You can implement a module that retrieve templates from the database, from the file system using a different path structure, you can provide them as hard-coded inline strings, or any manner that you see fit.

You can add additional instance variables, arguments, or methods as needed.

Example:

file_system = Solid.LocalFileSystem.new(template_path)
text = Solid.render(template, file_system: {Solid.LocalFileSystem, file_system})

This will render the template with a LocalFileSystem implementation rooted at 'template_path'.

Link to this section Summary

Link to this section Callbacks

Link to this callback

read_template_file(binary, options)

View Source

Specs

read_template_file(binary(), options :: any()) :: String.t() | no_return()