-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02aeb26
commit 38ecaa3
Showing
8 changed files
with
501 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
use minify_html::Cfg; | ||
use std::{env, fs, path::Path}; | ||
|
||
fn main() { | ||
fn build(page: &str, raw: &[u8]) { | ||
let out_dir = env::var("OUT_DIR").unwrap(); | ||
let dest_path = Path::new(&out_dir).join("index.html"); | ||
let page = include_bytes!("./static/index.html"); | ||
let minified = minify_html::minify(page, &Cfg::spec_compliant()); | ||
|
||
let dest_path = Path::new(&out_dir).join(page); | ||
let minified = minify_html::minify(raw, &Cfg::spec_compliant()); | ||
fs::write(dest_path, minified).expect("failed to save minified index page"); | ||
println!("cargo:rerun-if-changed=static"); | ||
} | ||
|
||
fn main() { | ||
build("index.html", include_bytes!("./static/index.html")); | ||
build("sign_in.html", include_bytes!("./static/sign_in.html")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.