Browse Source

Add some more text to zola init

Closes #773
index-subcmd
Vincent Prouillet 5 years ago
parent
commit
f0c48b8a14
2 changed files with 7 additions and 4 deletions
  1. +3
    -2
      docs/content/documentation/getting-started/cli-usage.md
  2. +4
    -2
      src/cmd/init.rs

+ 3
- 2
docs/content/documentation/getting-started/cli-usage.md View File

@@ -3,14 +3,15 @@ title = "CLI usage"
weight = 2 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 You can view the help of the whole program by running `zola --help` and
the command help by running `zola <cmd> --help`. the command help by running `zola <cmd> --help`.


## init ## 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 ```bash
$ zola init my_site $ zola init my_site


+ 4
- 2
src/cmd/init.rs View File

@@ -70,10 +70,11 @@ pub fn create_new_project(name: &str) -> Result<()> {
) )
} }
} }
} else {
create_dir(path)?;
} }

console::info("Welcome to Zola!"); 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 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)?; 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("%SEARCH%", &format!("{}", search))
.replace("%HIGHLIGHT%", &format!("{}", highlight)); .replace("%HIGHLIGHT%", &format!("{}", highlight));


create_dir(path)?;
create_file(&path.join("config.toml"), &config)?; create_file(&path.join("config.toml"), &config)?;


create_dir(path.join("content"))?; create_dir(path.join("content"))?;


Loading…
Cancel
Save