Skip to content

Commit

Permalink
Generate index.html for archive format.
Browse files Browse the repository at this point in the history
  • Loading branch information
syamajala committed Jul 15, 2024
1 parent 3318e24 commit 5cfc6d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/archive_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ 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 5cfc6d2

Please sign in to comment.