z_path (zotonic_core v1.0.0-rc.17)
Defines all paths for files and directories of a site.
Summary
Functions
Return the absolute path to a file in the 'file' directory
Return the _build/default/lib directory
Return the path to a files subdirectory
Return the path to a files subdirectory and ensure that the directory is present
Get the path to the root dir of the Zotonic install. If the env var 'ZOTONIC' is not set, then return the current working dir.
Return the path to the media archive directory
Return the path to the media preview directory
Return the path to the given module in the given context. The module must have been compiled, so it is present in the code path.
Return the path to the site folder of the given context. The site must have been compiled.
Find the source directory of a site.
The directory of the user-defined sites
Functions
-spec abspath(file:filename_all(), z:context()) -> file:filename_all() | {error, bad_name}.
Return the absolute path to a file in the 'file' directory
-spec build_lib_dir() -> file:filename_all().
Return the _build/default/lib directory
-spec files_subdir(file:filename_all(), z:context()) -> file:filename_all() | {error, bad_name}.
Return the path to a files subdirectory
-spec files_subdir_ensure(file:filename_all(), z:context()) -> file:filename_all() | {error, bad_name}.
Return the path to a files subdirectory and ensure that the directory is present
-spec get_path() -> file:filename_all().
Get the path to the root dir of the Zotonic install. If the env var 'ZOTONIC' is not set, then return the current working dir.
-spec media_archive(z:context()) -> file:filename_all() | {error, bad_name}.
Return the path to the media archive directory
-spec media_preview(z:context()) -> file:filename_all() | {error, bad_name}.
Return the path to the media preview directory
-spec module_dir(atom()) -> file:filename_all() | {error, bad_name}.
Return the path to the given module in the given context. The module must have been compiled, so it is present in the code path.
-spec site_dir(z:context() | atom()) -> file:filename_all() | {error, bad_name}.
Return the path to the site folder of the given context. The site must have been compiled.
-spec site_source_dir(z:context() | atom()) -> file:filename_all() | {error, bad_name}.
Find the source directory of a site.
-spec zotonic_apps() -> file:filename_all().
The directory of the user-defined sites