Skip to content

Commit

Permalink
Generate index.html for archive format (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
syamajala authored Jul 16, 2024
1 parent 3318e24 commit cf6c2cf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/archive_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,22 @@ impl<T: DeferredDataSource> DataSourceArchiveWriter<T> {
}
});

std::fs::write(
self.path.join("index.html"),
"<html>
<script>
window.onload = function() {
var prof = location
if(location.protocol !== 'https:') {
prof = location.replace(`https:${location.href.substring(location.protocol.length)}`);
}
window.location.replace(\"https://legion.stanford.edu/prof-viewer/?url=\"+prof.href);
}
</script>
</html>
",
)?;

Ok(())
}
}

0 comments on commit cf6c2cf

Please sign in to comment.