summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaster4385 <blaster4385@tablaster.dev>2024-04-21 19:20:06 +0530
committerBlaster4385 <blaster4385@tablaster.dev>2024-04-22 23:13:08 +0530
commitc81696200f75e3d3e842c4c781601ed06b5c35c1 (patch)
treea221a70a9ec556266a93bc683814a63ee78f88b5
parent3623473f7755d906121ae90f28da7a2ef11ecf1b (diff)
feat: render all markdown files through a single page
-rw-r--r--index.html12
-rw-r--r--question-guidelines.html52
2 files changed, 11 insertions, 53 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>
diff --git a/question-guidelines.html b/question-guidelines.html
deleted file mode 100644
index 4aeb7c3..0000000
--- a/question-guidelines.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <!-- Meta tags for SEO -->
- <meta name="description"
- content="How TF do I ask a question?">
- <meta name="keywords"
- content="Venkatesh Chaturvedi, Blaster4385, tablaster, FOSS, CLI tools, Atlassian, Linux, Android, Open Source">
- <meta name="author" content="Venkatesh Chaturvedi">
- <meta name="robots" content="index, follow">
- <!-- Open Graph meta tags for social sharing -->
- <meta property="og:title" content="Question Guidelines">
- <meta property="og:description"
- content="How TF do I ask a question?">
- <meta property="og:image" content="https://github.com/Blaster4385.png">
- <meta property="og:url" content="https://tablaster.dev">
- <meta property="og:type" content="website">
- <!-- Twitter Card meta tags for social sharing -->
- <meta name="twitter:card" content="summary">
- <meta name="twitter:creator" content="@Blaster4385">
- <meta name="twitter:title" content="Question Guidelines">
- <meta name="twitter:description"
- content="How TF do I ask a question?.">
- <meta name="twitter:image" content="https://github.com/Blaster4385.png">
- <title>Question Guidelines</title>
- <link rel="icon" type="image/png" href="https://github.com/Blaster4385.png">
- <link rel="preconnect" href="https://fonts.gstatic.com">
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap" rel="stylesheet">
- <link rel="stylesheet" href="styles.css">
- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
-</head>
-
-<body>
- <main class="container">
- <header id="header">
- <h1>$ tablaster.dev</h1>
- </header>
- <div id="markdown"></div>
- </main>
-
- <script src="markdown.js"></script>
- <script>
- document.addEventListener('DOMContentLoaded', function () {
- loadMarkdownFile('question-guidelines.md');
- });
- </script>
-</body>
-
-</html> \ No newline at end of file