diff --git a/docs/index.md b/docs/index.md index f35ad9a..6ae956a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,6 +2,11 @@ Welcome to the Documentation Here you'll find documentation for various tools and projects I've created. Select a document from the sidebar to get started. +## Configuration + +### Folder Structure +Folders in the sidebar can be configured to be open or closed by default using the `defaultOpen` flag in `index.json`: + ## Available Documentation - **[[DeepImpact]]** - A Blueprint Function Library for depth-based line traces in Unreal Engine diff --git a/index.js b/index.js index 5f442d6..820bfe8 100644 --- a/index.js +++ b/index.js @@ -48,14 +48,14 @@ async function initializeMarked() { function createFileIndexItem(doc, container, level = 0) { if (doc.type === 'folder') { const folderDiv = document.createElement('div'); - folderDiv.className = 'folder open'; + folderDiv.className = 'folder' + (doc.defaultOpen !== false ? ' open' : ''); folderDiv.dataset.path = doc.title; folderDiv.style.paddingLeft = `${level * 0.8}rem`; const folderHeader = document.createElement('div'); folderHeader.className = 'folder-header'; folderHeader.innerHTML = ` - + ${doc.title} `; folderDiv.appendChild(folderHeader);