FranklinTemplates.addtemplate
— Methodaddtemplate(path)
Assuming you're working with FranklinTemplates on development mode (i.e. ] dev FranklinTemplates
this function takes a path where you would have worked on a template and incorporates it into FranklinTemplates, putting files at the right place; this makes iterations and PRs easier.
Note: if you use this without FranklinTemplates on dev mode, bad things will likely occur.
FranklinTemplates.build_templates
— Methodbuild_templates()
Build all the templates.
FranklinTemplates.deduplicate
— Methoddeduplicate(src, dest)
Consider the files provided by src
and remove all identical files from dest
to avoid duplication.
FranklinTemplates.filecmp
— Methodfilecmp(path1, path2)
Take 2 absolute paths and check if the files are different (return false if different and true otherwise). This code was suggested by Steven J. Johnson on discourse: https://discourse.julialang.org/t/how-to-obtain-the-result-of-a-diff-between-2-files-in-a-loop/23784/4
FranklinTemplates.mergefolders
— Methodmergefolders(src, dst)
Internal function to looks at what's inside src/
and put it in dst/
. If there are paths that match, the files are merged. It is assumed that files will not clash, if they clash files in dst
are replaced. See also newsite
.
FranklinTemplates.modify
— Methodmodify(template_name)
Convenience function to quickly instantiate a directory with a given template once satisfied with the changes, they can be added to the repo by doing addtemplate(path)
.
FranklinTemplates.newsite
— Functionnewsite(topdir; template="basic", cd=true)
Generate a new folder (an error is thrown if it already exists) that contains the skeleton of a website that can be processed by Franklin. The user can specify a template
out of the list of available templates. If topdir
is specified as "."
then the current directory is used.
template="basic"
: name of the template to use,cd=true
: whether to change the current directory to the newly created folder or not.verbose=true
: whether to display information or not.
Example
newsite("MyNewWebsite", template="pure-sm")
FranklinTemplates.serve_templates
— Methodserve_templates()
Rebuild all templates upon detecting changes.