UNPKG

@asafarim/simple-md-viewer

Version:

A professional markdown viewer with file tree navigation, directory content browsing, and advanced YAML front matter support

34 lines (32 loc) 1.17 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>SMV | @asafarim/simple-md-viewer</title> <script type="module"> // This script helps with client-side routing // It ensures that direct navigation to routes works correctly (function() { // Save the current path before the single-page app loads const path = window.location.pathname; // Listen for the app to load window.addEventListener('load', function() { // If we're not at the root, we need to handle the route if (path !== '/' && !path.includes('.')) { // Let the app handle routing once it's loaded setTimeout(() => { window.history.replaceState(null, '', path); // Dispatch a popstate event to trigger route handling window.dispatchEvent(new PopStateEvent('popstate', { state: null })); }, 100); } }); })(); </script> </head> <body> <div id="root"></div> <script type="module" src="./src/main.tsx"></script> </body> </html>