Browse Source

Skip render=false sections in sitemap

Fix #604
index-subcmd
Vincent Prouillet 5 years ago
parent
commit
97d11995c5
3 changed files with 4 additions and 0 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -0
      components/site/src/lib.rs
  3. +2
    -0
      components/site/tests/site.rs

+ 1
- 0
CHANGELOG.md View File

@@ -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)


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

@@ -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::<Vec<_>>();
for section in


+ 2
- 0
components/site/tests/site.rs View File

@@ -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/</loc>"));

// robots.txt has been rendered from the template
assert!(file_contains!(public, "robots.txt", "User-agent: zola"));


Loading…
Cancel
Save