`index.html` can use the following placeholder variables to retrieve internal data.
- `__INDEX_DATA__`: directory listing data
-- `__ASSERTS_PREFIX__`: assets url prefix
+- `__ASSETS_PREFIX__`: assets url prefix
</details>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
- <link rel="icon" type="image/x-icon" href="__ASSERTS_PREFIX__favicon.ico">
- <link rel="stylesheet" href="__ASSERTS_PREFIX__index.css">
+ <link rel="icon" type="image/x-icon" href="__ASSETS_PREFIX__favicon.ico">
+ <link rel="stylesheet" href="__ASSETS_PREFIX__index.css">
<script>
DATA = __INDEX_DATA__
</script>
- <script src="__ASSERTS_PREFIX__index.js"></script>
+ <script src="__ASSETS_PREFIX__index.js"></script>
</head>
<body>
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
let output = self
.html
- .replace("__ASSERTS_PREFIX__", &self.assets_prefix)
+ .replace("__ASSETS_PREFIX__", &self.assets_prefix)
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?);
res.headers_mut()
.typed_insert(ContentLength(output.as_bytes().len() as u64));
res.headers_mut()
.typed_insert(ContentType::from(mime_guess::mime::TEXT_HTML_UTF_8));
self.html
- .replace("__ASSERTS_PREFIX__", &self.assets_prefix)
+ .replace("__ASSETS_PREFIX__", &self.assets_prefix)
.replace("__INDEX_DATA__", &serde_json::to_string(&data)?)
};
res.headers_mut()
if *directory == DIR_ASSETS {
tmpdir
.child(format!("{}{}", directory, "index.html"))
- .write_str("__ASSERTS_PREFIX__index.js;DATA = __INDEX_DATA__")
+ .write_str("__ASSETS_PREFIX__index.js;DATA = __INDEX_DATA__")
.unwrap();
} else {
for file in FILES {