z_lib_include (zotonic_core v1.0.0-rc.12)

Support for the {% lib filename ... %} tag in the templates. Generates the <link /> or %lt;script /%gt; tag for css or js files. Also adds the greatest modification date so that updates are loaded by the browser.

Link to this section Summary

Functions

Generate the link and/or script tags for the given files.
Generate the link and/or script tags for the given files.
Given the filepath of the request, return all files collapsed in the path.
Generate urls for the given files, js and css files are separated.
Generate urls for the given files, js and css files are separated.

Link to this section Types

-type option() ::
    minify |
    {minify, boolean()} |
    async |
    {async, boolean()} |
    absolute_url |
    {absolute_url, boolean()} |
    {media, binary()} |
    {rel, binary()} |
    {title, binary()}.
-type options() :: [option()].

Link to this section Functions

Link to this function

tag(Files, Context)

-spec tag([binary()], z:context()) -> [[binary()]].
Generate the link and/or script tags for the given files.
Link to this function

tag(Files, Args, Context)

-spec tag([binary()], options(), z:context()) -> [[binary()]].
Generate the link and/or script tags for the given files.
Link to this function

uncollapse(Path)

-spec uncollapse(string() | binary()) -> [binary()].
Given the filepath of the request, return all files collapsed in the path.
Link to this function

url(Files, Context)

-spec url([binary()], z:context()) -> [binary()].
Generate urls for the given files, js and css files are separated.
Link to this function

url(Files, Args, Context)

-spec url([binary()], options(), z:context()) -> [binary()].
Generate urls for the given files, js and css files are separated.