Still.Compiler.PassThroughCopy (Still v0.8.0) View Source
Copies a file from the input path to the output directory without changing it.
Matching parameters
You can configure matching parameters by setting
config :still,
pass_through_copy: ["img/logo.png"]
In the example above, the file logo.png
inside the img
folder will be copied
to the img
folder in the output. But if you write something like this:
config :still,
pass_through_copy: ["img"]
Any file or folder that starts with the string img
will be copied, which may
include an img
folder or a file named img.png
. So you need to be mindful
of that.
You can also use regular expressions:
config still,
pass_through_copy: [~r/.*.jpe?g/]
Sometimes you want to alter the file name or path but keep the content of the files. The configuration allows this by using tuples. The key will be used to match the input folder, and the value will be used to transform the input path:
config :still,
pass_through_copy: [css: "styles"]
# this is also valid:
# config :still,
# pass_through_copy: [{"css", "styles"}]
In the example above, the css
folder from the input folder but will be
renamed to styles
in the output folder.
Link to this section Summary
Link to this section Functions
Attempts to copy a file from the input path to the output directory without changing.
If the file doesn't match any configured name, :no_match
is returned.
See the Matching Parameters section.