Add configuration section for folder structure and update folder open state handling

This commit is contained in:
2025-02-04 15:54:38 +11:00
parent 0d4a579c23
commit 41298c9fa6
2 changed files with 7 additions and 2 deletions

View File

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

View File

@@ -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 = `
<i class="fas fa-folder-open folder-icon"></i>
<i class="fas fa-folder${doc.defaultOpen !== false ? '-open' : ''} folder-icon"></i>
<span>${doc.title}</span>
`;
folderDiv.appendChild(folderHeader);