mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 04:12:25 +00:00
Merge pull request #1816 from PR0M3TH3AN/fix-docs-paths-7294697130089922582
Fix docs content loading paths and add debug logging
This commit is contained in:
7 files changed
+12
-6
No files matched your search
@@ -365,7 +365,9 @@ function resolveDocItem(slug) {
|
||||
}
|
||||
|
||||
async function fetchToc() {
|
||||
logger.dev.log("fetchToc: fetching", TOC_URL);
|
||||
const response = await fetch(TOC_URL);
|
||||
logger.dev.log("fetchToc: response status", response.status);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load TOC (${response.status})`);
|
||||
}
|
||||
@@ -407,6 +409,8 @@ async function renderMarkdown(path) {
|
||||
|
||||
try {
|
||||
clearScrollSpy();
|
||||
logger.dev.log("renderMarkdown: fetching", path);
|
||||
|
||||
if (!window.marked || typeof window.marked.parse !== "function") {
|
||||
throw new Error("Markdown renderer is unavailable.");
|
||||
}
|
||||
@@ -584,8 +588,10 @@ function setupTocDrawer() {
|
||||
}
|
||||
|
||||
async function initDocsView() {
|
||||
logger.dev.log("initDocsView: starting");
|
||||
try {
|
||||
tocState.items = await fetchToc();
|
||||
logger.dev.log("initDocsView: TOC items loaded", tocState.items);
|
||||
indexItems(tocState.items);
|
||||
renderToc(tocState.items);
|
||||
setupTocDrawer();
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/about.md");
|
||||
const response = await fetch("content/docs/about.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load about.md");
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch the markdown file (change path if needed)
|
||||
const response = await fetch("content/community-guidelines.md");
|
||||
const response = await fetch("content/docs/community/community-guidelines.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load community-guidelines.md");
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch the Markdown file
|
||||
const response = await fetch("content/getting-started.md");
|
||||
const response = await fetch("content/docs/getting-started.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load getting-started.md");
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/links.md");
|
||||
const response = await fetch("content/docs/community/links.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load links.md");
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
// Fetch your roadmap markdown
|
||||
const response = await fetch("content/roadmap.md");
|
||||
const response = await fetch("content/docs/roadmap.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load roadmap.md");
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
const loadMarkdown = async () => {
|
||||
try {
|
||||
const response = await fetch("content/upload-content.md");
|
||||
const response = await fetch("content/docs/guides/upload-content.md");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load upload-content.md");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user