Add option for new page to not add the page to config.toml
This commit is contained in:
parent
52b2bab5fd
commit
5f2b40ad43
@ -12,10 +12,10 @@ items = ["about", "other", "google"]
|
||||
title = "Google!"
|
||||
link = "https://google.com"
|
||||
|
||||
[navbar.item.about]
|
||||
title = "About"
|
||||
link = "/"
|
||||
|
||||
[navbar.item.other]
|
||||
title = "Other"
|
||||
link = "/other"
|
||||
|
||||
[navbar.item.about]
|
||||
title = "About"
|
||||
link = "/"
|
||||
|
@ -109,6 +109,7 @@ pub fn generate_new_page(ops: NewOps, logger: &Logger) -> Result<(), Error> {
|
||||
|
||||
file_writer::write_file(markdown_path, PLACEHOLDER_MARKDOWN, ops.overwrite)?;
|
||||
|
||||
if !ops.no_modify_config {
|
||||
logger.log(
|
||||
LogLevel::INFO,
|
||||
format!("Adding page config path to config.toml"),
|
||||
@ -136,6 +137,7 @@ pub fn generate_new_page(ops: NewOps, logger: &Logger) -> Result<(), Error> {
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -50,4 +50,7 @@ pub struct NewOps {
|
||||
/// Overwrites existing .toml / .md files
|
||||
#[structopt(short = "o", long = "overwrite")]
|
||||
pub overwrite: bool,
|
||||
/// Don't modify config.toml automatically
|
||||
#[structopt(short = "n", long = "no-modify-config")]
|
||||
pub no_modify_config: bool,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user