Browse Source

Render draft pages in serve mode

index-subcmd
Vincent Prouillet 4 years ago
parent
commit
7c3a112d7d
3 changed files with 5 additions and 2 deletions
  1. +2
    -1
      CHANGELOG.md
  2. +2
    -1
      components/site/src/lib.rs
  3. +1
    -0
      src/cmd/serve.rs

+ 2
- 1
CHANGELOG.md View File

@@ -6,8 +6,9 @@
- Fix sitemaps namespace - Fix sitemaps namespace
- Update livereload - Update livereload
- Add `hard_link_static` config option to hard link things in the static directory instead of copying - Add `hard_link_static` config option to hard link things in the static directory instead of copying
- Draft pages are not longer rendered
- Draft pages are not longer rendered in `zola build`
- Add warning for old style internal links since they would still function - Add warning for old style internal links since they would still function
- Add some counts to `zola check`


## 0.8.0 (2019-06-22) ## 0.8.0 (2019-06-22)




+ 2
- 1
components/site/src/lib.rs View File

@@ -229,7 +229,8 @@ impl Site {
let mut pages_insert_anchors = HashMap::new(); let mut pages_insert_anchors = HashMap::new();
for page in pages { for page in pages {
let p = page?; let p = page?;
if p.meta.draft {
// Draft pages are not rendered in zola build so we just discard them
if p.meta.draft && self.config.is_in_build_mode() {
continue; continue;
} }
pages_insert_anchors.insert( pages_insert_anchors.insert(


+ 1
- 0
src/cmd/serve.rs View File

@@ -130,6 +130,7 @@ fn create_new_site(
format!("http://{}", base_address) format!("http://{}", base_address)
}; };


site.config.enable_serve_mode();
site.set_base_url(base_url); site.set_base_url(base_url);
site.set_output_path(output_dir); site.set_output_path(output_dir);
site.load()?; site.load()?;


Loading…
Cancel
Save