Module z_path

Defines all paths for files and directories of a site.

Copyright © 2009-2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Defines all paths for files and directories of a site.

Function Index

abspath/2Return the absolute path to a file in the 'file' directory.
build_lib_dir/0Return the _build/default/lib directory.
files_subdir/2Return the path to a files subdirectory.
files_subdir_ensure/2Return the path to a files subdirectory and ensure that the directory is present.
get_path/0Get the path to the root dir of the Zotonic install.
media_archive/1Return the path to the media archive directory.
media_preview/1Return the path to the media preview directory.
module_dir/1Return the path to the given module in the given context.
site_dir/1Return the path to the site folder of the given context.
site_source_dir/1Find the source directory of a site.
zotonic_apps/0The directory of the user-defined sites.

Function Details

abspath/2

abspath(Path::file:filename_all(), Context::z:context()) -> file:filename_all() | {error, bad_name}

Return the absolute path to a file in the 'file' directory

build_lib_dir/0

build_lib_dir() -> file:filename_all()

Return the _build/default/lib directory

files_subdir/2

files_subdir(SubDir::file:filename_all(), Context::z:context()) -> file:filename_all() | {error, bad_name}

Return the path to a files subdirectory

files_subdir_ensure/2

files_subdir_ensure(SubDir::file:filename_all(), Context::z:context()) -> file:filename_all() | {error, bad_name}

Return the path to a files subdirectory and ensure that the directory is present

get_path/0

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.

media_archive/1

media_archive(Context::z:context()) -> file:filename_all() | {error, bad_name}

Return the path to the media archive directory

media_preview/1

media_preview(Context::z:context()) -> file:filename_all() | {error, bad_name}

Return the path to the media preview directory

module_dir/1

module_dir(Module::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.

site_dir/1

site_dir(Context::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.

site_source_dir/1

site_source_dir(Context::z:context() | atom()) -> file:filename_all() | {error, bad_name}

Find the source directory of a site.

zotonic_apps/0

zotonic_apps() -> file:filename_all()

The directory of the user-defined sites


Generated by EDoc