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.

deduplicate(src, dest)

Consider the files provided by src and remove all identical files from dest to avoid duplication.

filecmp(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:

mergefolders(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.


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).

newsite(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.


newsite("MyNewWebsite", template="pure-sm")