z_lib_include (zotonic_core v1.0.0-rc.17)

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.

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.

Types

option/0

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

options/0

-type options() :: [option()].

Functions

tag(Files, Context)

-spec tag([binary()], z:context()) -> [[binary()]].

Generate the link and/or script tags for the given files.

tag(Files, Args, Context)

-spec tag([binary()], options(), z:context()) -> [[binary()]].

Generate the link and/or script tags for the given files.

uncollapse(Path)

-spec uncollapse(string() | binary()) -> [binary()].

Given the filepath of the request, return all files collapsed in the path.

url(Files, Context)

-spec url([binary()], z:context()) -> [binary()].

Generate urls for the given files, js and css files are separated.

url(Files, Args, Context)

-spec url([binary()], options(), z:context()) -> [binary()].

Generate urls for the given files, js and css files are separated.