summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/index.html b/index.html
index ca07552..b7d1822 100644
--- a/index.html
+++ b/index.html
@@ -44,7 +44,17 @@
<script src="markdown.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
- loadMarkdownFile('home.md');
+ // Get the pathname of the URL
+ const path = window.location.pathname;
+ // Remove leading slash if present
+ const trimmedPath = path.replace(/^\/|\/$/g, '');
+
+ if (trimmedPath === '') {
+ loadMarkdownFile('home.md');
+ return;
+ }
+ // Load the markdown file based on the path
+ loadMarkdownFile(`${trimmedPath}.md`);
});
</script>
</body>