diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a60d66..cbf56d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ a section - Add an id (`zola-continue-reading`) to the paragraph generated after a summary - Add Dracula syntax highlighting theme - Fix using inline styles in headers +- Fix sections with render=false being shown in sitemap ## 0.5.1 (2018-12-14) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 8a8e0b7..9445757 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -797,6 +797,7 @@ impl Site { .read().unwrap() .sections_values() .iter() + .filter(|s| s.meta.render) .map(|s| SitemapEntry::new(s.permalink.clone(), None)) .collect::>(); for section in diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index 7e025e7..c85033a 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -175,6 +175,8 @@ fn can_build_site_without_live_reload() { )); // Drafts are not in the sitemap assert!(!file_contains!(public, "sitemap.xml", "draft")); + // render: false sections are not in the sitemap either + assert!(!file_contains!(public, "sitemap.xml", "posts/2018/")); // robots.txt has been rendered from the template assert!(file_contains!(public, "robots.txt", "User-agent: zola"));