From f0c48b8a14850bbe5d9bbda1695ca8982cecdff1 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 13 Aug 2019 20:15:56 +0200 Subject: [PATCH] Add some more text to zola init Closes #773 --- docs/content/documentation/getting-started/cli-usage.md | 5 +++-- src/cmd/init.rs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/content/documentation/getting-started/cli-usage.md b/docs/content/documentation/getting-started/cli-usage.md index 16a64bc..c63c9ba 100644 --- a/docs/content/documentation/getting-started/cli-usage.md +++ b/docs/content/documentation/getting-started/cli-usage.md @@ -3,14 +3,15 @@ title = "CLI usage" weight = 2 +++ -Zola only has 3 commands: init, build and serve. +Zola only has 4 commands: `init`, `build`, `serve` and `check`. You can view the help of the whole program by running `zola --help` and the command help by running `zola --help`. ## init -Creates the directory structure used by Zola at the given directory. +Creates the directory structure used by Zola at the given directory after asking a few basic configuration questions. +Any choices made during those prompts can easily be changed by modifying the `config.toml`. ```bash $ zola init my_site diff --git a/src/cmd/init.rs b/src/cmd/init.rs index f032491..88233ff 100644 --- a/src/cmd/init.rs +++ b/src/cmd/init.rs @@ -70,10 +70,11 @@ pub fn create_new_project(name: &str) -> Result<()> { ) } } - } else { - create_dir(path)?; } + console::info("Welcome to Zola!"); + console::info("Please answer a few questions to get started quickly."); + console::info("Any choices made can be changed by modifying the `config.toml` file later."); let base_url = ask_url("> What is the URL of your site?", "https://example.com")?; let compile_sass = ask_bool("> Do you want to enable Sass compilation?", true)?; @@ -87,6 +88,7 @@ pub fn create_new_project(name: &str) -> Result<()> { .replace("%SEARCH%", &format!("{}", search)) .replace("%HIGHLIGHT%", &format!("{}", highlight)); + create_dir(path)?; create_file(&path.join("config.toml"), &config)?; create_dir(path.join("content"))?;