fix: minifiing
This commit is contained in:
parent
a8e009b957
commit
9254a6b1ee
6
build.rs
6
build.rs
@ -17,9 +17,9 @@ fn main() {
|
|||||||
println!("cargo:rerun-if-env-changed=FORCE_DEPS_DOWNLOAD");
|
println!("cargo:rerun-if-env-changed=FORCE_DEPS_DOWNLOAD");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=templates/");
|
println!("cargo:rerun-if-changed=templates/");
|
||||||
minify_template_file("templates/base.html", "templates/base.min.html").unwrap();
|
minify_template_file("templates/base.html", "templates/.base.min.html").unwrap();
|
||||||
minify_template_file("templates/dir.html", "templates/dir.min.html").unwrap();
|
minify_template_file("templates/dir.html", "templates/.dir.min.html").unwrap();
|
||||||
minify_template_file("templates/file.html", "templates/file.min.html").unwrap();
|
minify_template_file("templates/file.html", "templates/.file.min.html").unwrap();
|
||||||
|
|
||||||
let out_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let out_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
let assets_path = Path::new(&out_dir).join("assets");
|
let assets_path = Path::new(&out_dir).join("assets");
|
||||||
|
|||||||
@ -52,7 +52,7 @@ pub struct FileEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "dir.min.html")]
|
#[template(path = ".dir.min.html")]
|
||||||
pub struct DirectoryTemplate {
|
pub struct DirectoryTemplate {
|
||||||
pub title_path: String,
|
pub title_path: String,
|
||||||
pub files: Vec<FileEntry>,
|
pub files: Vec<FileEntry>,
|
||||||
@ -65,7 +65,7 @@ pub struct DirectoryTemplate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "file.min.html")]
|
#[template(path = ".file.min.html")]
|
||||||
pub struct NoteTemplate {
|
pub struct NoteTemplate {
|
||||||
pub filename: String,
|
pub filename: String,
|
||||||
pub back_link: String,
|
pub back_link: String,
|
||||||
|
|||||||
@ -236,8 +236,6 @@
|
|||||||
<script src="{{ mermaid_script_url }}"></script>
|
<script src="{{ mermaid_script_url }}"></script>
|
||||||
<script src="{{ highlight_script_url }}"></script>
|
<script src="{{ highlight_script_url }}"></script>
|
||||||
<script>
|
<script>
|
||||||
{% block scripts %}{% endblock %}
|
|
||||||
|
|
||||||
function copyCode(button) {
|
function copyCode(button) {
|
||||||
const wrapper = button.closest('.code-block-wrapper');
|
const wrapper = button.closest('.code-block-wrapper');
|
||||||
if (!wrapper) return;
|
if (!wrapper) return;
|
||||||
@ -276,5 +274,6 @@
|
|||||||
|
|
||||||
hljs.highlightAll();
|
hljs.highlightAll();
|
||||||
</script>
|
</script>
|
||||||
|
<script>{% block scripts %}{% endblock %}</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.min.html" %}
|
{% extends ".base.min.html" %}
|
||||||
|
|
||||||
{% block title %}Directory: /{{ title_path }}{% endblock %}
|
{% block title %}Directory: /{{ title_path }}{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.min.html" %}
|
{% extends ".base.min.html" %}
|
||||||
|
|
||||||
{% block title %}{{ filename }}{% endblock %}
|
{% block title %}{{ filename }}{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user