fix: typo __ASSERTS_PREFIX__ (#252)
This commit is contained in:
parent
9b3779b13a
commit
7f83de765a
4 changed files with 7 additions and 7 deletions
|
@ -344,7 +344,7 @@ Your assets folder must contains a `index.html` file.
|
||||||
`index.html` can use the following placeholder variables to retrieve internal data.
|
`index.html` can use the following placeholder variables to retrieve internal data.
|
||||||
|
|
||||||
- `__INDEX_DATA__`: directory listing data
|
- `__INDEX_DATA__`: directory listing data
|
||||||
- `__ASSERTS_PREFIX__`: assets url prefix
|
- `__ASSETS_PREFIX__`: assets url prefix
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<link rel="icon" type="image/x-icon" href="__ASSERTS_PREFIX__favicon.ico">
|
<link rel="icon" type="image/x-icon" href="__ASSETS_PREFIX__favicon.ico">
|
||||||
<link rel="stylesheet" href="__ASSERTS_PREFIX__index.css">
|
<link rel="stylesheet" href="__ASSETS_PREFIX__index.css">
|
||||||
<script>
|
<script>
|
||||||
DATA = __INDEX_DATA__
|
DATA = __INDEX_DATA__
|
||||||
</script>
|
</script>
|
||||||
<script src="__ASSERTS_PREFIX__index.js"></script>
|
<script src="__ASSETS_PREFIX__index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -775,7 +775,7 @@ impl Server {
|
||||||
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
|
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
|
||||||
let output = self
|
let output = self
|
||||||
.html
|
.html
|
||||||
.replace("__ASSERTS_PREFIX__", &self.assets_prefix)
|
.replace("__ASSETS_PREFIX__", &self.assets_prefix)
|
||||||
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?);
|
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?);
|
||||||
res.headers_mut()
|
res.headers_mut()
|
||||||
.typed_insert(ContentLength(output.as_bytes().len() as u64));
|
.typed_insert(ContentLength(output.as_bytes().len() as u64));
|
||||||
|
@ -1009,7 +1009,7 @@ impl Server {
|
||||||
res.headers_mut()
|
res.headers_mut()
|
||||||
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
|
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
|
||||||
self.html
|
self.html
|
||||||
.replace("__ASSERTS_PREFIX__", &self.assets_prefix)
|
.replace("__ASSETS_PREFIX__", &self.assets_prefix)
|
||||||
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?)
|
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?)
|
||||||
};
|
};
|
||||||
res.headers_mut()
|
res.headers_mut()
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub fn tmpdir() -> TempDir {
|
||||||
if *directory == DIR_ASSETS {
|
if *directory == DIR_ASSETS {
|
||||||
tmpdir
|
tmpdir
|
||||||
.child(format!("{}{}", directory, "index.html"))
|
.child(format!("{}{}", directory, "index.html"))
|
||||||
.write_str("__ASSERTS_PREFIX__index.js;DATA = __INDEX_DATA__")
|
.write_str("__ASSETS_PREFIX__index.js;DATA = __INDEX_DATA__")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
} else {
|
} else {
|
||||||
for file in FILES {
|
for file in FILES {
|
||||||
|
|
Loading…
Reference in a new issue