Still.Utils (Still v0.8.0) View Source

Collection of utility functions.

Link to this section Summary

Functions

Recursively removes all files from the site's output directory.

Recursively removes all files from the given path, relative to the output directory.

Returns true when the current execution was started by Elixir.Mix.Tasks.Still.Compile

Compiles a file's metadata.

Returns the value configured for :still by the given key. Returns the provided default if it doesn't exist.

Returns the value configured for :still by the given key. Errors if it doesn't exist.

Returns the site's base URL.

Delegates the call to the current Still.Image.Preprocessor.Adapter.

Returns the absolute path configured as the site's entrypoint.

Returns the current input path for a given file, prepending it with the site's input directory. See get_input_path/0.

Returns the modified time of a given file as a DateTime struct or the :error atom if the file doesn't exist.

Returns the modified time of a given file. Errors if the file does not exist.

Returns the absolute path configured as the site's output destination.

Returns the current output path for a given file, prepending it with the site's output directory. See get_output_path/0.

Receives an absolute path and converts it to relative by trimming the site's entrypoint directory.

Receives an absolute path and converts it to relative by trimming the site's entrypoint directory.

Checks whether a file should be ignored by Still or not.

Returns true if the modified time of the input file is different than the output file.

Returns true if the given file exists in the input path. Returns false otherwise.

Creates the output directory.

Creates the directory by the given path, relative to the output directory.

Recursively cleans the site's output directory.

Link to this section Functions

Recursively removes all files from the site's output directory.

Recursively removes all files from the given path, relative to the output directory.

Returns true when the current execution was started by Elixir.Mix.Tasks.Still.Compile

Link to this function

compile_file(file, opts \\ [])

View Source

Specs

compile_file(binary(), any()) :: [Still.SourceFile.t()]

Compiles a file.

Link to this function

compile_file_metadata(file, opts \\ [])

View Source

Specs

compile_file_metadata(binary(), any()) :: [Still.SourceFile.t()]

Compiles a file's metadata.

Returns the value configured for :still by the given key. Returns the provided default if it doesn't exist.

Returns the value configured for :still by the given key. Errors if it doesn't exist.

Returns the site's base URL.

Delegates the call to the current Still.Image.Preprocessor.Adapter.

Returns the absolute path configured as the site's entrypoint.

This is the value set by

config :still, input: "path/to/site"

Returns the current input path for a given file, prepending it with the site's input directory. See get_input_path/0.

Returns the modified time of a given file as a DateTime struct or the :error atom if the file doesn't exist.

Link to this function

get_modified_time!(path)

View Source

Returns the modified time of a given file. Errors if the file does not exist.

Returns the absolute path configured as the site's output destination.

This is the value set by

config :still, output: "path/to/site"

Returns the current output path for a given file, prepending it with the site's output directory. See get_output_path/0.

Link to this function

get_relative_input_path(full_path)

View Source

Receives an absolute path and converts it to relative by trimming the site's entrypoint directory.

Link to this function

get_relative_output_path(full_path)

View Source

Receives an absolute path and converts it to relative by trimming the site's entrypoint directory.

Specs

ignored_file?(binary()) :: boolean()

Checks whether a file should be ignored by Still or not.

Link to this function

input_file_changed?(input_file, output_file)

View Source

Returns true if the modified time of the input file is different than the output file.

Link to this function

input_file_exists?(file)

View Source

Returns true if the given file exists in the input path. Returns false otherwise.

Creates the output directory.

Creates the directory by the given path, relative to the output directory.

Link to this function

render_file(input_file, opts \\ [])

View Source

Specs

render_file(binary(), any()) :: [Still.SourceFile.t()]

Renders a file.

Recursively cleans the site's output directory.