You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Library | waifuism.life</title>
|
|
<link rel="stylesheet" href="styles.css">
|
|
<script src="/libs/marked.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="window">
|
|
<div class="nav">
|
|
<button onclick="loadContent('home.md')">Home</button>
|
|
<a href="./logs/"><button>Logs</button></a>
|
|
<a href="./grimoire/"><button>Grimoire</button></a>
|
|
</div>
|
|
<div class="content" id="mainContent">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function loadContent(file) {
|
|
fetch(`markdown/${file}`)
|
|
.then(response => {
|
|
if (!response.ok) {
|
|
throw new Error(`Network response was not ok: ${response.statusText}`);
|
|
}
|
|
return response.text();
|
|
})
|
|
.then(text => {
|
|
const mainContent = document.getElementById('mainContent');
|
|
mainContent.innerHTML = marked.parse(text); // Changed to marked.parse
|
|
})
|
|
.catch(error => {
|
|
console.error('Error loading content:', error);
|
|
const mainContent = document.getElementById('mainContent');
|
|
mainContent.innerHTML = `<p>Error loading content. Please try again later.</p>`;
|
|
});
|
|
}
|
|
|
|
// Load the default home content on page load
|
|
window.onload = function() {
|
|
loadContent('home.md');
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|