Files
bitvid/views/upload-content.html
T
google-labs-jules[bot]andPR0M3TH3AN d490fa1295 Fix incorrect markdown file paths in documentation views
- Updated `fetch` paths in legacy views (getting-started, upload-content, about, roadmap, community-guidelines, links) to point to the correct locations in `content/docs/`.
- Added debug logging to `js/docsView.js` to assist in diagnosing "Loading content..." hangs in the new documentation system.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 15:07:16 +00:00

78 lines
2.6 KiB
HTML

<!-- 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>