Skip to content

Commit

Permalink
Make the favicon real
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfeldman committed Oct 22, 2023
1 parent fee7a6d commit 9573cf8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/docs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,18 @@ pub fn generate_docs_html(root_file: PathBuf) {
struct Assets<S: AsRef<str>> {
search_js: S,
styles_css: S,
favicon_svg: S,
raw_template_html: S,
}

#[cfg(not(debug_assertions))]
let assets = {
let search_js = include_str!("./static/search.js");
let styles_css = include_str!("./static/styles.css");
let favicon_svg = include_str!("./static/favicon.svg");
let raw_template_html = include_str!("./static/index.html");

Assets {
search_js,
styles_css,
favicon_svg,
raw_template_html,
}
};
Expand All @@ -71,13 +68,11 @@ pub fn generate_docs_html(root_file: PathBuf) {
// Read the assets from the filesystem
let search_js = fs::read_to_string(static_dir.join("search.js")).unwrap();
let styles_css = fs::read_to_string(static_dir.join("styles.css")).unwrap();
let favicon_svg = fs::read_to_string(static_dir.join("favicon.svg")).unwrap();
let raw_template_html = fs::read_to_string(static_dir.join("index.html")).unwrap();

Assets {
search_js,
styles_css,
favicon_svg,
raw_template_html,
}
};
Expand All @@ -87,7 +82,6 @@ pub fn generate_docs_html(root_file: PathBuf) {
for (file, contents) in [
("search.js", assets.search_js),
("styles.css", assets.styles_css),
("favicon.svg", assets.favicon_svg),
] {
let dir = build_dir.join(file);
fs::write(&dir, contents).unwrap_or_else(|error| {
Expand Down
File renamed without changes

0 comments on commit 9573cf8

Please sign in to comment.