added hack to use notes with extension .md

This commit is contained in:
Gamosoft 2025-12-10 09:17:25 +01:00
parent 598901e629
commit b97eb70287
1 changed files with 8 additions and 1 deletions

View File

@ -1910,7 +1910,14 @@ function noteApp() {
// Load note from URL path // Load note from URL path
loadNoteFromURL() { loadNoteFromURL() {
// Get path from URL (e.g., /folder/note or /note) // Get path from URL (e.g., /folder/note or /note)
const path = window.location.pathname; let path = window.location.pathname;
// Strip .md extension if present (for MKdocs/Zensical integration)
if (path.toLowerCase().endsWith('.md')) {
path = path.slice(0, -3);
// Update URL bar to show clean path without .md
window.history.replaceState(null, '', path);
}
// Skip if root path or static assets // Skip if root path or static assets
if (path === '/' || path.startsWith('/static/') || path.startsWith('/api/')) { if (path === '/' || path.startsWith('/static/') || path.startsWith('/api/')) {