mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
48 lines
1.5 KiB
HTML
48 lines
1.5 KiB
HTML
<!-- views/about.html -->
|
|
<section class="bv-stack" data-ds="new" aria-labelledby="aboutHeading">
|
|
<article class="card p-lg">
|
|
<div class="bv-stack bv-stack--tight">
|
|
<h2 id="aboutHeading" class="text-2xl font-semibold text-text-strong">
|
|
About bitvid
|
|
</h2>
|
|
<div id="markdown-container" class="markdown-prose">
|
|
<p class="text-muted-strong">Loading content...</p>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
</section>
|
|
|
|
<script>
|
|
(async () => {
|
|
try {
|
|
const response = await fetch("content/about.md");
|
|
if (!response.ok) {
|
|
throw new Error("Failed to load about.md");
|
|
}
|
|
const markdownText = await response.text();
|
|
|
|
// Convert the markdown to HTML (requires "marked" loaded globally)
|
|
const html = marked.parse(markdownText);
|
|
|
|
// Insert the HTML into the container
|
|
const container = document.getElementById("markdown-container");
|
|
if (container) {
|
|
container.innerHTML = html;
|
|
}
|
|
|
|
// (Optional) Highlight code blocks if "hljs" is available globally
|
|
document.querySelectorAll("pre code").forEach((block) => {
|
|
hljs.highlightBlock(block);
|
|
});
|
|
} catch (err) {
|
|
console.error("Error loading About content:", err);
|
|
const container = document.getElementById("markdown-container");
|
|
if (container) {
|
|
container.innerHTML = `
|
|
<p class="text-critical-strong">Error loading content. Please try again later.</p>
|
|
`;
|
|
}
|
|
}
|
|
})();
|
|
</script>
|