refactor: split css/js from index.html (#68)

This commit is contained in:
sigoden
2022-06-21 23:01:00 +08:00
committed by GitHub
parent 7f062b6705
commit e29cf4c752
4 changed files with 113 additions and 55 deletions

View File

@@ -37,12 +37,8 @@ pub fn encode_uri(v: &str) -> String {
fn retrive_index_paths_impl(index: &str) -> Option<HashSet<String>> {
let lines: Vec<&str> = index.lines().collect();
let (i, _) = lines
.iter()
.enumerate()
.find(|(_, v)| v.contains("const DATA"))?;
let line = lines.get(i + 1)?;
let value: Value = line.parse().ok()?;
let line = lines.iter().find(|v| v.contains("DATA ="))?;
let value: Value = line[7..].parse().ok()?;
let paths = value
.get("paths")?
.as_array()?