Name the index section
This commit is contained in:
parent
77ad6547e5
commit
6508b7e4d3
|
@ -9,6 +9,7 @@
|
|||
- Add `section` to a page Tera context if there is one
|
||||
- Add `aliases` to pages for when you are changing urls but want to redirect
|
||||
to the new one
|
||||
- Name the homepage section `index` (previously empty string)
|
||||
|
||||
## 0.0.6 (2017-05-24)
|
||||
|
||||
|
|
|
@ -499,10 +499,12 @@ impl Site {
|
|||
|
||||
/// Create a hashmap of paths to section
|
||||
/// For example `content/posts/_index.md` key will be `posts`
|
||||
/// The index section will always be called `index` so don't use a path such as
|
||||
/// `content/index/_index.md` yourself
|
||||
fn get_sections_map(&self) -> HashMap<String, Section> {
|
||||
self.sections
|
||||
.values()
|
||||
.map(|s| (s.file.components.join("/"), s.clone()))
|
||||
.map(|s| (if s.is_index() { "index".to_string() } else { s.file.components.join("/") }, s.clone()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue