refactor: no inline scripts in HTML (#391)

* Moved 'ready' func call from index.html

Inline script moved to index.js

* Moved <script> out from index.html

* moved inline-styling to css

* minor formatting changes

* changed ratio from const to let

* refactor

* fix tests

---------

Co-authored-by: sigoden <sigoden@gmail.com>
This commit is contained in:
Need4Swede
2024-05-30 17:51:59 -07:00
committed by GitHub
parent ce740b1fb1
commit dc7a7cbb3f
6 changed files with 81 additions and 59 deletions

View File

@@ -65,7 +65,7 @@ pub fn tmpdir() -> TempDir {
if *directory == DIR_ASSETS {
tmpdir
.child(format!("{}{}", directory, "index.html"))
.write_str("__ASSETS_PREFIX__index.js;DATA = __INDEX_DATA__")
.write_str("__ASSETS_PREFIX__index.js;<template id=\"index-data\">__INDEX_DATA__</template>")
.unwrap();
} else {
for file in FILES {