mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Refactor docs navigation and clean up legacy views
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
7e09a7e353
commit
cfd7c49a9d
9 files changed
+94
-523
No files matched your search
@@ -1,74 +0,0 @@
|
||||
<!-- 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>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/docs/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;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.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>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
@@ -1,78 +0,0 @@
|
||||
<!-- views/community-guidelines.html -->
|
||||
<section class="bv-stack" data-ds="new" aria-labelledby="communityGuidelinesHeading">
|
||||
<article class="card p-lg">
|
||||
<div class="bv-stack bv-stack--tight">
|
||||
<h2
|
||||
id="communityGuidelinesHeading"
|
||||
class="text-2xl font-semibold text-text-strong"
|
||||
>
|
||||
Community Guidelines
|
||||
</h2>
|
||||
<div id="markdown-container" class="markdown-prose">
|
||||
<p class="text-muted-strong">Loading content...</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch the markdown file (change path if needed)
|
||||
const response = await fetch("content/docs/community/community-guidelines.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load community-guidelines.md");
|
||||
}
|
||||
const markdownText = await response.text();
|
||||
|
||||
// Convert to HTML with Marked (make sure Marked is loaded globally in index.html)
|
||||
const html = marked.parse(markdownText);
|
||||
|
||||
// Insert into the container
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = html;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.error("Error loading community guidelines:", err);
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = `
|
||||
<p class="text-critical-strong">Error loading content. Please try again later.</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
@@ -1,79 +0,0 @@
|
||||
<!-- views/getting-started.html -->
|
||||
<section class="bv-stack" data-ds="new" aria-labelledby="gettingStartedHeading">
|
||||
<article class="card p-lg">
|
||||
<div class="bv-stack bv-stack--tight">
|
||||
<h2
|
||||
id="gettingStartedHeading"
|
||||
class="text-2xl font-semibold text-text-strong"
|
||||
>
|
||||
Getting Started
|
||||
</h2>
|
||||
<div id="markdown-container" class="markdown-prose">
|
||||
<p class="text-muted-strong">Loading content...</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch the Markdown file
|
||||
const response = await fetch("content/docs/getting-started.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load getting-started.md");
|
||||
}
|
||||
|
||||
const markdownText = await response.text();
|
||||
|
||||
// Convert to HTML with Marked (assuming marked is globally available)
|
||||
const html = marked.parse(markdownText);
|
||||
|
||||
// Insert into #markdown-container
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = html;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.error("Error loading 'Getting Started' 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>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
@@ -1,74 +0,0 @@
|
||||
<!-- views/links.html -->
|
||||
<section class="bv-stack" data-ds="new" aria-labelledby="linksHeading">
|
||||
<article class="card p-lg">
|
||||
<div class="bv-stack bv-stack--tight">
|
||||
<h2 id="linksHeading" class="text-2xl font-semibold text-text-strong">
|
||||
bitvid Links
|
||||
</h2>
|
||||
<div id="markdown-container" class="markdown-prose">
|
||||
<p class="text-muted-strong">Loading content...</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/docs/community/links.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load links.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;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.error("Error loading Links 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>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
@@ -1,75 +0,0 @@
|
||||
<!-- views/roadmap.html -->
|
||||
<section class="bv-stack" data-ds="new" aria-labelledby="roadmapHeading">
|
||||
<article class="card p-lg">
|
||||
<div class="bv-stack bv-stack--tight">
|
||||
<h2 id="roadmapHeading" class="text-2xl font-semibold text-text-strong">
|
||||
Roadmap
|
||||
</h2>
|
||||
<div id="markdown-container" class="markdown-prose">
|
||||
<p class="text-muted-strong">Loading content...</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch your roadmap markdown
|
||||
const response = await fetch("content/docs/roadmap.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load roadmap.md");
|
||||
}
|
||||
const markdownText = await response.text();
|
||||
|
||||
// Convert markdown to HTML (marked must be globally available)
|
||||
const html = marked.parse(markdownText);
|
||||
|
||||
// Insert into the container
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = html;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.error("Error loading roadmap:", err);
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = `
|
||||
<p class="text-critical-strong">Error loading content. Please try again later.</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!-- views/upload-content.html -->
|
||||
<section class="bv-stack" data-ds="new" aria-labelledby="uploadContentHeading">
|
||||
<article class="card p-lg">
|
||||
<div class="bv-stack bv-stack--tight">
|
||||
<div class="flex items-center gap-3">
|
||||
<img src="assets/svg/upload-content-icon.svg" alt="" class="h-8 w-8 text-accent" aria-hidden="true" />
|
||||
<h2 id="uploadContentHeading" class="text-2xl font-semibold text-text-strong">
|
||||
Upload Content
|
||||
</h2>
|
||||
</div>
|
||||
<div id="markdown-container" class="markdown-prose">
|
||||
<p class="text-muted-strong">Loading content...</p>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
// Provide no-op fallback loggers so embeds stay functional if bitvidLogger is unavailable.
|
||||
const noopLogger = {
|
||||
log: () => {},
|
||||
info: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
};
|
||||
const dev = window.bitvidLogger?.dev || noopLogger;
|
||||
const user = window.bitvidLogger?.user || noopLogger;
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/docs/guides/upload-content.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load upload-content.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;
|
||||
|
||||
const highlighter = window.hljs;
|
||||
const highlight =
|
||||
highlighter && typeof highlighter.highlightElement === "function"
|
||||
? (block) => highlighter.highlightElement(block)
|
||||
: highlighter && typeof highlighter.highlightBlock === "function"
|
||||
? (block) => highlighter.highlightBlock(block)
|
||||
: null;
|
||||
|
||||
if (highlight) {
|
||||
container.querySelectorAll("pre code").forEach((block) => {
|
||||
try {
|
||||
highlight(block);
|
||||
} catch (highlightError) {
|
||||
dev.warn("Failed to highlight code block.", highlightError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
user.error("Error loading Upload Content guide:", err);
|
||||
const container = document.getElementById("markdown-container");
|
||||
if (container) {
|
||||
container.innerHTML = `
|
||||
<p class="text-critical-strong">Error loading content. Please try again later.</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
loadMarkdown();
|
||||
})();
|
||||
</script>
|
||||
Reference in new issue
Block a user