Still.Compiler.TemplateHelpers (Still v0.8.0) View Source
Set of helper functions to be included in a file that runs through an Elixir preprocessor.
Link to this section Summary
Functions
Returns the collections for the current file.
Renders a file in the page using the variables defined in metadata
.
Renders the link using Still.Compiler.TemplateHelpers.Link.render/3
.
Converts a relative path to an absolute one.
Safely renders the content by escaping any HTML tags.
Truncates the string.
Link to this section Functions
Returns the collections for the current file.
Renders a file in the page using the variables defined in metadata
.
Renders the link using Still.Compiler.TemplateHelpers.Link.render/3
.
Converts a relative path to an absolute one.
Examples
File paths are always relative to the root folder, but sometimes it's too cumbersome, and we need to reference a file relative to the current folder.
For instance, when called inside the file "blog/post/index.md":
path_expand("./cover.png")
# "blog/post/./cover.png"
Safely renders the content by escaping any HTML tags.
Truncates the string.
Options
escape
- applysafe_html/1
after truncating. Defaults tofalse
.
See further supported options in Still.TemplateHelpers.Truncate
.