From d11f4aa56a40ee001fff6e9fab1f8d0722d56224 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Thu, 13 Sep 2018 17:07:14 +0200 Subject: [PATCH] Do not load markdown files starting with a . --- CHANGELOG.md | 1 + components/site/src/lib.rs | 1 + test_site/content/.should-not-be-picked-up.md | 0 3 files changed, 2 insertions(+) create mode 100644 test_site/content/.should-not-be-picked-up.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ad7ad64..8428700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix `--base-url` not overriding processed images URLs - Many many times faster (x10-x20) for sites with thousands of pages - Add more Emacs temp file to the ignored patterns in `gutenberg serve` +- Files starting with `.` are not considered pages anymore even if they end with `.md` ## 0.4.2 (2018-09-03) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index ba70aef..6ce1a4f 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -179,6 +179,7 @@ impl Site { let (section_entries, page_entries): (Vec<_>, Vec<_>) = glob(&content_glob) .unwrap() .filter_map(|e| e.ok()) + .filter(|e| !e.as_path().file_name().unwrap().to_str().unwrap().starts_with(".")) .partition(|entry| entry.as_path().file_name().unwrap() == "_index.md"); let sections = { diff --git a/test_site/content/.should-not-be-picked-up.md b/test_site/content/.should-not-be-picked-up.md new file mode 100644 index 0000000..e69de29