From a465d6a61eec49a5ec172ae0f5de499c2b1e71ab Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 19 Nov 2018 17:19:05 +0100 Subject: [PATCH] Fix deleting while zola serve --- CHANGELOG.md | 5 +++++ components/library/src/content/page.rs | 2 +- components/rebuild/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ceee9d..3908d8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.5.1 (unreleased) + +- Fix deleting markdown file in `zola serve` + + ## 0.5.0 (2018-11-17) ### Breaking diff --git a/components/library/src/content/page.rs b/components/library/src/content/page.rs index 122df166..96fe5244 100644 --- a/components/library/src/content/page.rs +++ b/components/library/src/content/page.rs @@ -21,7 +21,7 @@ use content::ser::SerializingPage; lazy_static! { // Check whether a string starts with yyyy-mm-dd{-,_} - static ref DATE_IN_FILENAME: Regex = Regex::new(r"^^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))(_|-)").unwrap(); + static ref DATE_IN_FILENAME: Regex = Regex::new(r"^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))(_|-)").unwrap(); } #[derive(Clone, Debug, PartialEq)] diff --git a/components/rebuild/src/lib.rs b/components/rebuild/src/lib.rs index 454e2c57..dad6ede3 100644 --- a/components/rebuild/src/lib.rs +++ b/components/rebuild/src/lib.rs @@ -311,7 +311,7 @@ pub fn after_content_change(site: &mut Site, path: &Path) -> Result<()> { if is_md { // only delete if it was able to be added in the first place if !index.exists() && !path.exists() { - delete_element(site, path, is_section)?; + return delete_element(site, path, is_section); } // Added another .md in a assets directory