Browse Source

Add sections to index page context

index-subcmd
Vincent Prouillet 7 years ago
parent
commit
f4db5180ba
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      CHANGELOG.md
  2. +1
    -0
      src/site.rs

+ 6
- 0
CHANGELOG.md View File

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

+ 1
- 0
src/site.rs View File

@@ -316,6 +316,7 @@ impl Site {
pages.sort_by(|a, b| a.partial_cmp(b).unwrap()); pages.sort_by(|a, b| a.partial_cmp(b).unwrap());


context.add("pages", &populate_previous_and_next_pages(&pages, false)); context.add("pages", &populate_previous_and_next_pages(&pages, false));
context.add("sections", &self.sections.values().collect::<Vec<&Section>>());
context.add("config", &self.config); context.add("config", &self.config);
let index = self.templates.render("index.html", &context)?; let index = self.templates.render("index.html", &context)?;
create_file(public.join("index.html"), &self.inject_livereload(index))?; create_file(public.join("index.html"), &self.inject_livereload(index))?;


Loading…
Cancel
Save