From f4db5180bacb335cb2f4c6ee9eefa390c6e4c2db Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 27 Mar 2017 11:48:01 +0900 Subject: [PATCH] Add sections to index page context --- CHANGELOG.md | 6 ++++++ src/site.rs | 1 + 2 files changed, 7 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..8b2f77b3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +## 0.0.3 (unreleased) +- Add some colours in console +- Allow using a file other than config.toml for config +- Add sections to the index page context diff --git a/src/site.rs b/src/site.rs index 638e2e95..88b592c5 100644 --- a/src/site.rs +++ b/src/site.rs @@ -316,6 +316,7 @@ impl Site { pages.sort_by(|a, b| a.partial_cmp(b).unwrap()); context.add("pages", &populate_previous_and_next_pages(&pages, false)); + context.add("sections", &self.sections.values().collect::>()); context.add("config", &self.config); let index = self.templates.render("index.html", &context)?; create_file(public.join("index.html"), &self.inject_livereload(index))?;