diff --git a/src/content.rs b/src/content.rs index 8aafa75..166f244 100644 --- a/src/content.rs +++ b/src/content.rs @@ -83,9 +83,17 @@ pub fn all_pages(dir: PathBuf, show_unpublished: bool) -> anyhow::Result() { + Ok(content) => { + if show_unpublished || content.published { + contents.insert(f.to_string_lossy().to_string(), content.into()); + } + }, + Err(e) => { + // If a parse fails, don't take down the entire site. Just skip this piece of content. + eprintln!("File {:?}: {}", &f, e); + continue + } } } Ok(contents)