Skip to content

Commit

Permalink
mv doc into else
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Oct 8, 2024
1 parent ef71dc7 commit 8b8f18e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/templates/.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,30 @@
} else {
console.error('Error fetching JSON:', response.status);
}
} else {
document.addEventListener("DOMContentLoaded", function () {
// Render the README.md file
fetch('README.md')
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.text();
})
.then(text => {
const contentDiv = document.getElementById('content');
contentDiv.innerHTML = marked.parse(text);
document.getElementById('loading').style.display = 'none';
contentDiv.style.display = 'block';
hljs.highlightAll();
})
.catch(error => {
console.error('Error fetching README:', error);
document.getElementById('loading').textContent = 'Failed to load README.md';
});
});
}
})();

document.addEventListener("DOMContentLoaded", function () {
// Render the README.md file
fetch('README.md')
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.text();
})
.then(text => {
const contentDiv = document.getElementById('content');
contentDiv.innerHTML = marked.parse(text);
document.getElementById('loading').style.display = 'none';
contentDiv.style.display = 'block';
hljs.highlightAll();
})
.catch(error => {
console.error('Error fetching README:', error);
document.getElementById('loading').textContent = 'Failed to load README.md';
});
});
</script>
</body>

Expand Down

0 comments on commit 8b8f18e

Please sign in to comment.