Replace Docusaurus site with static HTML
This commit is contained in:
15
docs/docs.js
Normal file
15
docs/docs.js
Normal file
@@ -0,0 +1,15 @@
|
||||
async function loadDoc() {
|
||||
const hash = decodeURIComponent(location.hash.slice(1)) || '01-get-started/01-What-is-Stardust';
|
||||
const file = hash + '.md';
|
||||
const res = await fetch(file);
|
||||
const container = document.getElementById('content');
|
||||
if (!res.ok) {
|
||||
container.textContent = 'Document not found.';
|
||||
return;
|
||||
}
|
||||
let text = await res.text();
|
||||
text = text.replace(/^---[\s\S]*?---\n/, '');
|
||||
container.innerHTML = marked.parse(text);
|
||||
}
|
||||
window.addEventListener('hashchange', loadDoc);
|
||||
window.addEventListener('load', loadDoc);
|
||||
23
docs/index.html
Normal file
23
docs/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Stardust XR Docs</title>
|
||||
<link rel="stylesheet" href="../style.css" />
|
||||
<link rel="icon" type="image/png" href="../static/img/icon.png" />
|
||||
<script src="../js/marked.min.js"></script>
|
||||
<script src="docs.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1><a href="../index.html" style="color:inherit;text-decoration:none;">Stardust XR Docs</a></h1>
|
||||
<nav>
|
||||
<a href="../index.html">Home</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<div id="content">Loading...</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user