getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.12k stars 925 forks source link

Enable zola init to take configuration command line arguments #1838

Open bkmgit opened 2 years ago

bkmgit commented 2 years ago

At present zola init can take only two further command line arguments, the directory name and forcing creation of a project. Zola init asks for:

  1. The site url
  2. Whether sass compilation should be enabled
  3. Whether syntax highlighting should be enabled
  4. Whether search should be enabled

Being able to specify these as command line arguments would be helpful in using Zola with CI systems to generate sites without downloading it to a command line.

Alternatively, one might want to simply give an example config.toml file and indicate that folders content, sass, static, templates and themes need to be created. This could be done as a documentation update. Happy to implement either option.

Keats commented 2 years ago

Why would you run zola init on CI? The simplest config.toml that would work is only filling the base_url, eg base_url = "https://www.vincentprouillet.com". For the directory structure, it's already documented in https://www.getzola.org/documentation/getting-started/directory-structure/ what do you want to add?