@knowcode/doc-builder 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,43 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.5.1] - 2025-07-21
9
+
10
+ ### Added
11
+ - Automatic redirect from .md URLs to their corresponding .html files
12
+ - Client-side JavaScript to intercept clicks on .md links and redirect to .html
13
+ - Custom 404.html page with automatic redirect logic for direct .md URL navigation
14
+ - Enhanced vercel.json generation to include 404 page routing
15
+
16
+ ### Fixed
17
+ - Fixed 404 errors when clicking or navigating to .md links
18
+ - Links like `claude-workflow-guide.md` now automatically redirect to `claude-workflow-guide.html`
19
+
20
+ ### Background
21
+ - Users reported that links to .md files resulted in 404 errors
22
+ - Implemented client-side solution to handle both link clicks and direct navigation
23
+ - Works seamlessly with Vercel's cleanUrls configuration
24
+
25
+ ## [1.5.0] - 2025-07-21
26
+
27
+ ### Added
28
+ - Comprehensive SEO features including meta tags, Open Graph, Twitter Cards
29
+ - JSON-LD structured data for better search engine understanding
30
+ - Automatic sitemap.xml and robots.txt generation
31
+ - Interactive `setup-seo` CLI command to configure SEO settings
32
+ - SEO configuration options in doc-builder.config.js
33
+ - Production URL configuration with `set-production-url` command
34
+ - Support for custom production URLs via config file, CLI command, or deployment flag
35
+
36
+ ### Improved
37
+ - Better deployment URL detection with multiple fallback methods
38
+ - Enhanced meta tag generation with author, keywords, and canonical URLs
39
+ - Social media preview support with customizable images and descriptions
40
+
41
+ ### Documentation
42
+ - Added comprehensive SEO guide explaining all features and configuration
43
+ - Updated troubleshooting guide with npx cache clearing instructions
44
+
8
45
  ## [1.4.26] - 2025-07-21
9
46
 
10
47
  ### Improved
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Page Not Found - Redirecting...</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
8
+ <style>
9
+ body {
10
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
11
+ margin: 0;
12
+ padding: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ min-height: 100vh;
17
+ background-color: #f7f7f5;
18
+ color: #37352f;
19
+ }
20
+ .container {
21
+ text-align: center;
22
+ padding: 2rem;
23
+ max-width: 600px;
24
+ }
25
+ h1 {
26
+ font-size: 3rem;
27
+ margin: 0 0 1rem 0;
28
+ color: #37352f;
29
+ }
30
+ p {
31
+ font-size: 1.125rem;
32
+ line-height: 1.6;
33
+ color: #6b6b6b;
34
+ margin: 0 0 2rem 0;
35
+ }
36
+ a {
37
+ color: #0366d6;
38
+ text-decoration: none;
39
+ }
40
+ a:hover {
41
+ text-decoration: underline;
42
+ }
43
+ .emoji {
44
+ font-size: 4rem;
45
+ margin-bottom: 1rem;
46
+ }
47
+ .loading {
48
+ display: none;
49
+ color: #0366d6;
50
+ margin-top: 1rem;
51
+ }
52
+ .redirect-message {
53
+ display: none;
54
+ background-color: #e8f4fd;
55
+ border: 1px solid #c3e0f7;
56
+ padding: 1rem;
57
+ border-radius: 8px;
58
+ margin-top: 1rem;
59
+ }
60
+ </style>
61
+ </head>
62
+ <body>
63
+ <div class="container">
64
+ <div class="emoji">🔍</div>
65
+ <h1>404</h1>
66
+ <p id="message">The page you're looking for doesn't exist.</p>
67
+ <div id="redirect-message" class="redirect-message">
68
+ Redirecting to the correct page...
69
+ </div>
70
+ <p id="loading" class="loading">Redirecting...</p>
71
+ <p>
72
+ <a href="/" id="home-link">Go to Home</a>
73
+ </p>
74
+ </div>
75
+
76
+ <script>
77
+ // Check if the URL ends with .md
78
+ const pathname = window.location.pathname;
79
+
80
+ if (pathname.endsWith('.md')) {
81
+ // Convert .md to .html
82
+ const htmlPath = pathname.replace(/\.md$/, '.html');
83
+
84
+ // Show redirect message
85
+ document.getElementById('message').textContent = 'Found a markdown link. Redirecting to the HTML version...';
86
+ document.getElementById('redirect-message').style.display = 'block';
87
+ document.getElementById('loading').style.display = 'block';
88
+
89
+ // Redirect after a brief delay to show the message
90
+ setTimeout(() => {
91
+ window.location.replace(htmlPath);
92
+ }, 500);
93
+ } else {
94
+ // For true 404s, show the standard message
95
+ document.getElementById('message').textContent = "The page you're looking for doesn't exist.";
96
+
97
+ // Also check if we can suggest a similar page
98
+ // Remove common suffixes and try to find a match
99
+ const basePath = pathname
100
+ .replace(/\.(html|htm|php|asp|aspx)$/, '')
101
+ .replace(/\/$/, '');
102
+
103
+ if (basePath && basePath !== pathname) {
104
+ document.getElementById('message').innerHTML =
105
+ `The page you're looking for doesn't exist.<br>
106
+ <small>Did you mean <a href="${basePath}.html">${basePath}.html</a>?</small>`;
107
+ }
108
+ }
109
+
110
+ // Update home link to use the correct base URL
111
+ const baseUrl = window.location.origin;
112
+ document.getElementById('home-link').href = baseUrl;
113
+ </script>
114
+ </body>
115
+ </html>
package/assets/js/main.js CHANGED
@@ -1318,8 +1318,31 @@ function initTooltips() {
1318
1318
  });
1319
1319
  }
1320
1320
 
1321
+ // Handle .md link redirects
1322
+ function initMarkdownLinkRedirects() {
1323
+ // Check if current URL ends with .md and redirect
1324
+ if (window.location.pathname.endsWith('.md')) {
1325
+ const htmlPath = window.location.pathname.replace(/\.md$/, '.html');
1326
+ console.log(`Redirecting from .md to .html: ${htmlPath}`);
1327
+ window.location.replace(htmlPath);
1328
+ return; // Stop execution as we're redirecting
1329
+ }
1330
+
1331
+ // Intercept clicks on .md links
1332
+ document.addEventListener('click', function(e) {
1333
+ const link = e.target.closest('a');
1334
+ if (link && link.href && link.href.endsWith('.md')) {
1335
+ e.preventDefault();
1336
+ const htmlUrl = link.href.replace(/\.md$/, '.html');
1337
+ console.log(`Converting .md link to .html: ${htmlUrl}`);
1338
+ window.location.href = htmlUrl;
1339
+ }
1340
+ });
1341
+ }
1342
+
1321
1343
  // Initialize on DOM Load
1322
1344
  document.addEventListener('DOMContentLoaded', () => {
1345
+ initMarkdownLinkRedirects();
1323
1346
  highlightNavigation();
1324
1347
  generateTableOfContents();
1325
1348
  initSidebarResize();
@@ -1,38 +1,34 @@
1
1
  module.exports = {
2
- // Site info
3
- siteName: 'Doc Builder',
4
- siteDescription: 'Beautiful documentation with the least effort possible',
5
-
6
- // Directories
7
- docsDir: 'docs',
8
- outputDir: 'html',
9
-
10
- // Production URL
11
- productionUrl: 'https://doc-builder-delta.vercel.app',
12
-
13
- // Features
14
- features: {
15
- authentication: false,
16
- changelog: true,
17
- mermaid: true,
18
- darkMode: true
2
+ "siteName": "Doc Builder",
3
+ "siteDescription": "Beautiful documentation with the least effort possible",
4
+ "docsDir": "docs",
5
+ "outputDir": "html",
6
+ "productionUrl": "https://doc-builder-delta.vercel.app",
7
+ "features": {
8
+ "authentication": false,
9
+ "changelog": true,
10
+ "mermaid": true,
11
+ "darkMode": true
19
12
  },
20
-
21
- // SEO configuration
22
- seo: {
23
- enabled: true,
24
- siteUrl: 'https://doc-builder-delta.vercel.app',
25
- author: 'Lindsay Smith',
26
- twitterHandle: '@planbbackups',
27
- language: 'en-US',
28
- keywords: ['documentation', 'markdown', 'static site generator', 'vercel', 'notion-style'],
29
- organization: {
30
- name: 'KnowCode',
31
- url: 'https://knowcode.com'
32
- },
33
- ogImage: '/og-default.png',
34
- generateSitemap: true,
35
- generateRobotsTxt: true,
36
- customMetaTags: []
13
+ "seo": {
14
+ "enabled": true,
15
+ "siteUrl": "https://doc-builder-delta.vercel.app",
16
+ "author": "Lindsay Smith",
17
+ "twitterHandle": "@planbbackups",
18
+ "language": "en-US",
19
+ "keywords": [
20
+ "documentation",
21
+ "markdown",
22
+ "static site generator",
23
+ "vercel",
24
+ "notion-style"
25
+ ],
26
+ "generateSitemap": true,
27
+ "generateRobotsTxt": true,
28
+ "ogImage": "/og-default.png",
29
+ "organization": {
30
+ "name": "Knowcode Ltd",
31
+ "url": "https://knowcode.tech"
32
+ }
37
33
  }
38
- };
34
+ };
package/html/404.html ADDED
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Page Not Found - Redirecting...</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
8
+ <style>
9
+ body {
10
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
11
+ margin: 0;
12
+ padding: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ min-height: 100vh;
17
+ background-color: #f7f7f5;
18
+ color: #37352f;
19
+ }
20
+ .container {
21
+ text-align: center;
22
+ padding: 2rem;
23
+ max-width: 600px;
24
+ }
25
+ h1 {
26
+ font-size: 3rem;
27
+ margin: 0 0 1rem 0;
28
+ color: #37352f;
29
+ }
30
+ p {
31
+ font-size: 1.125rem;
32
+ line-height: 1.6;
33
+ color: #6b6b6b;
34
+ margin: 0 0 2rem 0;
35
+ }
36
+ a {
37
+ color: #0366d6;
38
+ text-decoration: none;
39
+ }
40
+ a:hover {
41
+ text-decoration: underline;
42
+ }
43
+ .emoji {
44
+ font-size: 4rem;
45
+ margin-bottom: 1rem;
46
+ }
47
+ .loading {
48
+ display: none;
49
+ color: #0366d6;
50
+ margin-top: 1rem;
51
+ }
52
+ .redirect-message {
53
+ display: none;
54
+ background-color: #e8f4fd;
55
+ border: 1px solid #c3e0f7;
56
+ padding: 1rem;
57
+ border-radius: 8px;
58
+ margin-top: 1rem;
59
+ }
60
+ </style>
61
+ </head>
62
+ <body>
63
+ <div class="container">
64
+ <div class="emoji">🔍</div>
65
+ <h1>404</h1>
66
+ <p id="message">The page you're looking for doesn't exist.</p>
67
+ <div id="redirect-message" class="redirect-message">
68
+ Redirecting to the correct page...
69
+ </div>
70
+ <p id="loading" class="loading">Redirecting...</p>
71
+ <p>
72
+ <a href="/" id="home-link">Go to Home</a>
73
+ </p>
74
+ </div>
75
+
76
+ <script>
77
+ // Check if the URL ends with .md
78
+ const pathname = window.location.pathname;
79
+
80
+ if (pathname.endsWith('.md')) {
81
+ // Convert .md to .html
82
+ const htmlPath = pathname.replace(/\.md$/, '.html');
83
+
84
+ // Show redirect message
85
+ document.getElementById('message').textContent = 'Found a markdown link. Redirecting to the HTML version...';
86
+ document.getElementById('redirect-message').style.display = 'block';
87
+ document.getElementById('loading').style.display = 'block';
88
+
89
+ // Redirect after a brief delay to show the message
90
+ setTimeout(() => {
91
+ window.location.replace(htmlPath);
92
+ }, 500);
93
+ } else {
94
+ // For true 404s, show the standard message
95
+ document.getElementById('message').textContent = "The page you're looking for doesn't exist.";
96
+
97
+ // Also check if we can suggest a similar page
98
+ // Remove common suffixes and try to find a match
99
+ const basePath = pathname
100
+ .replace(/\.(html|htm|php|asp|aspx)$/, '')
101
+ .replace(/\/$/, '');
102
+
103
+ if (basePath && basePath !== pathname) {
104
+ document.getElementById('message').innerHTML =
105
+ `The page you're looking for doesn't exist.<br>
106
+ <small>Did you mean <a href="${basePath}.html">${basePath}.html</a>?</small>`;
107
+ }
108
+ }
109
+
110
+ // Update home link to use the correct base URL
111
+ const baseUrl = window.location.origin;
112
+ document.getElementById('home-link').href = baseUrl;
113
+ </script>
114
+ </body>
115
+ </html>
package/html/README.html CHANGED
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.105Z",
62
- "dateModified": "2025-07-21T20:24:35.105Z",
61
+ "datePublished": "2025-07-21T20:39:06.468Z",
62
+ "dateModified": "2025-07-21T20:39:06.468Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/README.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.114Z",
62
- "dateModified": "2025-07-21T20:24:35.114Z",
61
+ "datePublished": "2025-07-21T20:39:06.478Z",
62
+ "dateModified": "2025-07-21T20:39:06.478Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/claude-workflow-guide.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.117Z",
62
- "dateModified": "2025-07-21T20:24:35.117Z",
61
+ "datePublished": "2025-07-21T20:39:06.481Z",
62
+ "dateModified": "2025-07-21T20:39:06.481Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/documentation-index.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.119Z",
62
- "dateModified": "2025-07-21T20:24:35.119Z",
61
+ "datePublished": "2025-07-21T20:39:06.483Z",
62
+ "dateModified": "2025-07-21T20:39:06.483Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/guides/authentication-guide.html"
@@ -98,7 +98,7 @@
98
98
 
99
99
  <div class="header-actions">
100
100
  <div class="deployment-info">
101
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
101
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
102
102
  </div>
103
103
 
104
104
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.123Z",
62
- "dateModified": "2025-07-21T20:24:35.123Z",
61
+ "datePublished": "2025-07-21T20:39:06.486Z",
62
+ "dateModified": "2025-07-21T20:39:06.486Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/guides/documentation-standards.html"
@@ -98,7 +98,7 @@
98
98
 
99
99
  <div class="header-actions">
100
100
  <div class="deployment-info">
101
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
101
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
102
102
  </div>
103
103
 
104
104
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.126Z",
62
- "dateModified": "2025-07-21T20:24:35.126Z",
61
+ "datePublished": "2025-07-21T20:39:06.489Z",
62
+ "dateModified": "2025-07-21T20:39:06.489Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/guides/seo-guide.html"
@@ -98,7 +98,7 @@
98
98
 
99
99
  <div class="header-actions">
100
100
  <div class="deployment-info">
101
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
101
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
102
102
  </div>
103
103
 
104
104
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.129Z",
62
- "dateModified": "2025-07-21T20:24:35.129Z",
61
+ "datePublished": "2025-07-21T20:39:06.492Z",
62
+ "dateModified": "2025-07-21T20:39:06.492Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/guides/troubleshooting-guide.html"
@@ -98,7 +98,7 @@
98
98
 
99
99
  <div class="header-actions">
100
100
  <div class="deployment-info">
101
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
101
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
102
102
  </div>
103
103
 
104
104
 
package/html/index.html CHANGED
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.105Z",
62
- "dateModified": "2025-07-21T20:24:35.105Z",
61
+ "datePublished": "2025-07-21T20:39:06.468Z",
62
+ "dateModified": "2025-07-21T20:39:06.468Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/README.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
package/html/js/main.js CHANGED
@@ -1318,8 +1318,31 @@ function initTooltips() {
1318
1318
  });
1319
1319
  }
1320
1320
 
1321
+ // Handle .md link redirects
1322
+ function initMarkdownLinkRedirects() {
1323
+ // Check if current URL ends with .md and redirect
1324
+ if (window.location.pathname.endsWith('.md')) {
1325
+ const htmlPath = window.location.pathname.replace(/\.md$/, '.html');
1326
+ console.log(`Redirecting from .md to .html: ${htmlPath}`);
1327
+ window.location.replace(htmlPath);
1328
+ return; // Stop execution as we're redirecting
1329
+ }
1330
+
1331
+ // Intercept clicks on .md links
1332
+ document.addEventListener('click', function(e) {
1333
+ const link = e.target.closest('a');
1334
+ if (link && link.href && link.href.endsWith('.md')) {
1335
+ e.preventDefault();
1336
+ const htmlUrl = link.href.replace(/\.md$/, '.html');
1337
+ console.log(`Converting .md link to .html: ${htmlUrl}`);
1338
+ window.location.href = htmlUrl;
1339
+ }
1340
+ });
1341
+ }
1342
+
1321
1343
  // Initialize on DOM Load
1322
1344
  document.addEventListener('DOMContentLoaded', () => {
1345
+ initMarkdownLinkRedirects();
1323
1346
  highlightNavigation();
1324
1347
  generateTableOfContents();
1325
1348
  initSidebarResize();
package/html/sitemap.xml CHANGED
@@ -1,68 +1,74 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ <url>
4
+ <loc>https://doc-builder-delta.vercel.app/404.html</loc>
5
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
6
+ <changefreq>monthly</changefreq>
7
+ <priority>0.6</priority>
8
+ </url>
3
9
  <url>
4
10
  <loc>https://doc-builder-delta.vercel.app/README.html</loc>
5
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
11
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
6
12
  <changefreq>monthly</changefreq>
7
13
  <priority>0.6</priority>
8
14
  </url>
9
15
  <url>
10
16
  <loc>https://doc-builder-delta.vercel.app/claude-workflow-guide.html</loc>
11
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
17
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
12
18
  <changefreq>monthly</changefreq>
13
19
  <priority>0.8</priority>
14
20
  </url>
15
21
  <url>
16
22
  <loc>https://doc-builder-delta.vercel.app/documentation-index.html</loc>
17
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
23
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
18
24
  <changefreq>monthly</changefreq>
19
25
  <priority>0.6</priority>
20
26
  </url>
21
27
  <url>
22
28
  <loc>https://doc-builder-delta.vercel.app/guides/authentication-guide.html</loc>
23
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
29
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
24
30
  <changefreq>monthly</changefreq>
25
31
  <priority>0.8</priority>
26
32
  </url>
27
33
  <url>
28
34
  <loc>https://doc-builder-delta.vercel.app/guides/document-standards.html</loc>
29
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
35
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
30
36
  <changefreq>monthly</changefreq>
31
37
  <priority>0.8</priority>
32
38
  </url>
33
39
  <url>
34
40
  <loc>https://doc-builder-delta.vercel.app/guides/documentation-standards.html</loc>
35
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
41
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
36
42
  <changefreq>monthly</changefreq>
37
43
  <priority>0.8</priority>
38
44
  </url>
39
45
  <url>
40
46
  <loc>https://doc-builder-delta.vercel.app/guides/seo-guide.html</loc>
41
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
47
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
42
48
  <changefreq>monthly</changefreq>
43
49
  <priority>0.8</priority>
44
50
  </url>
45
51
  <url>
46
52
  <loc>https://doc-builder-delta.vercel.app/guides/troubleshooting-guide.html</loc>
47
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
53
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
48
54
  <changefreq>monthly</changefreq>
49
55
  <priority>0.8</priority>
50
56
  </url>
51
57
  <url>
52
58
  <loc>https://doc-builder-delta.vercel.app/index.html</loc>
53
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
59
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
54
60
  <changefreq>weekly</changefreq>
55
61
  <priority>1.0</priority>
56
62
  </url>
57
63
  <url>
58
64
  <loc>https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html</loc>
59
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
65
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
60
66
  <changefreq>monthly</changefreq>
61
67
  <priority>0.8</priority>
62
68
  </url>
63
69
  <url>
64
70
  <loc>https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html</loc>
65
- <lastmod>2025-07-21T20:24:35.142Z</lastmod>
71
+ <lastmod>2025-07-21T20:39:06.503Z</lastmod>
66
72
  <changefreq>monthly</changefreq>
67
73
  <priority>0.8</priority>
68
74
  </url>
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.131Z",
62
- "dateModified": "2025-07-21T20:24:35.131Z",
61
+ "datePublished": "2025-07-21T20:39:06.494Z",
62
+ "dateModified": "2025-07-21T20:39:06.494Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/vercel-cli-setup-guide.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
@@ -55,11 +55,11 @@
55
55
  },
56
56
  "publisher": {
57
57
  "@type": "Organization",
58
- "name": "KnowCode",
59
- "url": "https://knowcode.com"
58
+ "name": "Knowcode Ltd",
59
+ "url": "https://knowcode.tech"
60
60
  },
61
- "datePublished": "2025-07-21T20:24:35.134Z",
62
- "dateModified": "2025-07-21T20:24:35.134Z",
61
+ "datePublished": "2025-07-21T20:39:06.497Z",
62
+ "dateModified": "2025-07-21T20:39:06.497Z",
63
63
  "mainEntityOfPage": {
64
64
  "@type": "WebPage",
65
65
  "@id": "https://doc-builder-delta.vercel.app/vercel-first-time-setup-guide.html"
@@ -92,7 +92,7 @@
92
92
 
93
93
  <div class="header-actions">
94
94
  <div class="deployment-info">
95
- <span class="deployment-date" title="Built with doc-builder v1.4.26">Last updated: Jul 21, 2025, 08:24 PM UTC</span>
95
+ <span class="deployment-date" title="Built with doc-builder v1.5.0">Last updated: Jul 21, 2025, 08:39 PM UTC</span>
96
96
  </div>
97
97
 
98
98
 
@@ -700,6 +700,13 @@ async function buildDocumentation(config) {
700
700
  await createAuthPages(outputDir, config);
701
701
  }
702
702
 
703
+ // Copy 404.html for handling .md redirects
704
+ const notFoundSource = path.join(assetsDir, '404.html');
705
+ if (fs.existsSync(notFoundSource)) {
706
+ await fs.copy(notFoundSource, path.join(outputDir, '404.html'), { overwrite: true });
707
+ console.log(chalk.green('✅ Copied 404.html for .md link handling'));
708
+ }
709
+
703
710
  // Create index.html from index.html, README.html, or generate default
704
711
  const indexPath = path.join(outputDir, 'index.html');
705
712
  const indexSourcePath = path.join(outputDir, 'index.html'); // from index.md
package/lib/deploy.js CHANGED
@@ -93,6 +93,16 @@ async function setupVercelProject(config) {
93
93
  }
94
94
  ]
95
95
  }
96
+ ],
97
+ "routes": [
98
+ {
99
+ "handle": "filesystem"
100
+ },
101
+ {
102
+ "src": "/(.*)",
103
+ "status": 404,
104
+ "dest": "/404.html"
105
+ }
96
106
  ]
97
107
  };
98
108
 
@@ -265,6 +275,16 @@ async function deployToVercel(config, isProd = false) {
265
275
  }
266
276
  ]
267
277
  }
278
+ ],
279
+ "routes": [
280
+ {
281
+ "handle": "filesystem"
282
+ },
283
+ {
284
+ "src": "/(.*)",
285
+ "status": 404,
286
+ "dest": "/404.html"
287
+ }
268
288
  ]
269
289
  };
270
290
  fs.writeJsonSync(vercelConfigPath, vercelConfig, { spaces: 2 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {