@knowcode/doc-builder 1.1.6 → 1.1.7

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,19 @@ 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.1.7] - 2025-07-19
9
+
10
+ ### Fixed
11
+ - Fixed CSS and JS assets not loading on deployed Vercel sites
12
+ - Changed all asset paths from relative to absolute URLs (/css/, /js/)
13
+ - Fixed missing styling on deployed documentation
14
+ - Corrected asset path resolution for Vercel's static hosting
15
+
16
+ ### Changed
17
+ - All HTML templates now use absolute paths for CSS and JS files
18
+ - Logo links now use absolute paths for consistent navigation
19
+ - Index.html generation uses absolute asset paths
20
+
8
21
  ## [1.1.6] - 2025-01-19
9
22
 
10
23
  ### Fixed
@@ -82,7 +82,8 @@ function generateHTML(title, content, navigation, currentPath = '', config = {})
82
82
  <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
83
83
 
84
84
  <!-- Styles -->
85
- <link rel="stylesheet" href="${relativePath}css/notion-style.css">
85
+ <link rel="stylesheet" href="/css/notion-style.css">
86
+ <link rel="stylesheet" href="/css/style.css">
86
87
 
87
88
  <!-- Favicon -->
88
89
  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>šŸ“š</text></svg>">
@@ -91,7 +92,7 @@ function generateHTML(title, content, navigation, currentPath = '', config = {})
91
92
  <!-- Header -->
92
93
  <header class="header">
93
94
  <div class="header-content">
94
- <a href="${relativePath}index.html" class="logo">${siteName}</a>
95
+ <a href="/index.html" class="logo">${siteName}</a>
95
96
 
96
97
  <div class="header-actions">
97
98
  <div class="deployment-info">
@@ -138,8 +139,8 @@ function generateHTML(title, content, navigation, currentPath = '', config = {})
138
139
  </div>
139
140
 
140
141
  <!-- Scripts -->
141
- <script src="${relativePath}js/main.js"></script>
142
- ${config.features?.authentication ? `<script src="${relativePath}js/auth.js"></script>` : ''}
142
+ <script src="/js/main.js"></script>
143
+ ${config.features?.authentication ? `<script src="/js/auth.js"></script>` : ''}
143
144
  </body>
144
145
  </html>`;
145
146
  }
package/lib/deploy.js CHANGED
@@ -186,6 +186,17 @@ async function deployToVercel(config, isProd = false) {
186
186
  throw new Error(`Output directory ${outputPath} does not exist. Run 'doc-builder build' first.`);
187
187
  }
188
188
 
189
+ // Check if CSS files exist
190
+ const cssPath = path.join(outputPath, 'css', 'style.css');
191
+ if (!fs.existsSync(cssPath)) {
192
+ console.log(chalk.yellow('\nāš ļø Warning: CSS files not found in output directory!'));
193
+ console.log(chalk.yellow(' Your documentation may appear without styling.'));
194
+ console.log(chalk.cyan('\nšŸ’” To fix this:'));
195
+ console.log(chalk.white(' 1. Update to latest version: ') + chalk.gray('npm update @knowcode/doc-builder'));
196
+ console.log(chalk.white(' 2. Rebuild your docs: ') + chalk.gray('npx @knowcode/doc-builder build'));
197
+ console.log(chalk.white(' 3. Then deploy again: ') + chalk.gray('npx @knowcode/doc-builder deploy\n'));
198
+ }
199
+
189
200
  // Simple deployment message
190
201
  console.log(chalk.blue('\nšŸš€ Starting deployment to Vercel...'));
191
202
  console.log(chalk.gray('This will take a few seconds...\n'));
@@ -343,7 +354,7 @@ async function prepareDeployment(config) {
343
354
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
344
355
  <meta http-equiv="refresh" content="0; url=README.html">
345
356
  <title>Redirecting...</title>
346
- <link rel="stylesheet" href="css/style.css">
357
+ <link rel="stylesheet" href="/css/style.css">
347
358
  </head>
348
359
  <body>
349
360
  <div style="text-align: center; margin-top: 50px;">
@@ -367,8 +378,8 @@ async function prepareDeployment(config) {
367
378
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
368
379
  <title>Documentation</title>
369
380
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
370
- <link rel="stylesheet" href="css/style.css">
371
- <link rel="stylesheet" href="css/notion-style.css">
381
+ <link rel="stylesheet" href="/css/style.css">
382
+ <link rel="stylesheet" href="/css/notion-style.css">
372
383
  </head>
373
384
  <body>
374
385
  <div class="navigation">
@@ -407,7 +418,7 @@ async function prepareDeployment(config) {
407
418
  </div>
408
419
  </div>
409
420
  </div>
410
- <script src="js/main.js"></script>
421
+ <script src="/js/main.js"></script>
411
422
  <style>
412
423
  .doc-card:hover {
413
424
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
@@ -418,6 +429,7 @@ async function prepareDeployment(config) {
418
429
  </html>`;
419
430
  fs.writeFileSync(indexPath, indexHtml);
420
431
  console.log(chalk.green('āœ… Created index.html with file listing'));
432
+ console.log(chalk.yellow('šŸ“Œ Remember to rebuild before deploying to see styling!'));
421
433
  }
422
434
  }
423
435
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowcode/doc-builder",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Reusable documentation builder for markdown-based sites with Vercel deployment support",
5
5
  "main": "index.js",
6
6
  "bin": {