Skip to content

Commit

Permalink
What's up with docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 29, 2024
1 parent f1041a4 commit 6703855
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,20 @@ fn build_documentation(workspace: &Path, args: BuildDocumentationArgs) -> Result
}

// Copy any additional assets to the documentation's output path:
fs::copy(resources.join("esp-rs.svg"), output_path.join("esp-rs.svg"))?;
fs::copy(resources.join("esp-rs.svg"), output_path.join("esp-rs.svg"))
.context("Failed to copy esp-rs.svg")?;

// Render the index and write it out to the documentaiton's output path:
let source = fs::read_to_string(resources.join("index.html.jinja"))?;
let source = fs::read_to_string(resources.join("index.html.jinja"))
.context("Failed to read index.html.jinja")?;

let mut env = minijinja::Environment::new();
env.add_template("index", &source)?;

let tmpl = env.get_template("index")?;
let html = tmpl.render(minijinja::context! { packages => packages })?;

fs::write(output_path.join("index.html"), html)?;
fs::write(output_path.join("index.html"), html).context("Failed to write index.html")?;

Ok(())
}
Expand Down

0 comments on commit 6703855

Please sign in to comment.