@knowcode/doc-builder 1.7.6 → 1.8.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.
Files changed (50) hide show
  1. package/.claude/settings.local.json +6 -1
  2. package/CHANGELOG.md +29 -0
  3. package/assets/css/notion-style.css +9 -1
  4. package/assets/js/main.js +10 -6
  5. package/html/README.html +44 -20
  6. package/html/auth.js +62 -13
  7. package/html/css/notion-style.css +9 -1
  8. package/html/documentation-index.html +44 -20
  9. package/html/guides/authentication-default-change.html +44 -20
  10. package/html/guides/authentication-guide.html +228 -263
  11. package/html/guides/claude-workflow-guide.html +44 -20
  12. package/html/guides/documentation-standards.html +44 -20
  13. package/html/guides/phosphor-icons-guide.html +44 -20
  14. package/html/guides/private-directory-authentication.html +472 -0
  15. package/html/guides/public-site-deployment.html +50 -25
  16. package/html/guides/search-engine-verification-guide.html +44 -20
  17. package/html/guides/seo-guide.html +44 -20
  18. package/html/guides/seo-optimization-guide.html +44 -20
  19. package/html/guides/troubleshooting-guide.html +44 -20
  20. package/html/guides/windows-setup-guide.html +44 -20
  21. package/html/index.html +44 -20
  22. package/html/js/auth.js +118 -39
  23. package/html/js/main.js +10 -6
  24. package/html/login.html +4 -4
  25. package/html/logout.html +2 -2
  26. package/html/private/cache-control-anti-pattern.html +408 -0
  27. package/html/private/launch/README.html +350 -0
  28. package/html/private/launch/auth-cleanup-summary.html +340 -0
  29. package/html/private/launch/bubble-plugin-specification.html +986 -0
  30. package/html/private/launch/go-to-market-strategy.html +716 -0
  31. package/html/private/launch/launch-announcements.html +646 -0
  32. package/html/private/launch/vercel-deployment-auth-setup.html +390 -0
  33. package/html/private/next-steps-walkthrough.html +685 -0
  34. package/html/private/supabase-auth-implementation-completed.html +433 -0
  35. package/html/private/supabase-auth-implementation-plan.html +590 -0
  36. package/html/private/supabase-auth-integration-plan.html +718 -0
  37. package/html/private/supabase-auth-setup-guide.html +545 -0
  38. package/html/private/test-private-doc.html +281 -0
  39. package/html/robots.txt +4 -0
  40. package/html/sitemap.xml +113 -29
  41. package/html/vercel-cli-setup-guide.html +44 -20
  42. package/html/vercel-first-time-setup-guide.html +44 -20
  43. package/lib/config.js +21 -3
  44. package/lib/core-builder.js +49 -7
  45. package/lib/supabase-auth.js +80 -25
  46. package/package.json +1 -1
  47. package/user-management/README.md +306 -0
  48. package/user-management/add-users.sh +730 -0
  49. package/user-management/create-user.js +65 -0
  50. package/user-management/users.txt +15 -0
@@ -0,0 +1,472 @@
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
+ <meta name="description" content="The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a `private`...">
7
+ <title>Private Directory Authentication Guide</title>
8
+
9
+ <meta name="author" content="Lindsay Smith">
10
+ <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, private, authentication">
11
+ <meta name="robots" content="index, follow">
12
+ <link rel="canonical" href="https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html">
13
+
14
+ <!-- Open Graph / Facebook -->
15
+ <meta property="og:type" content="article">
16
+ <meta property="og:url" content="https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html">
17
+ <meta property="og:title" content="Private Directory Authentication Guide">
18
+ <meta property="og:description" content="The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a `private`...">
19
+ <meta property="og:image" content="https://doc-builder-delta.vercel.app/og-default.png">
20
+ <meta property="og:site_name" content="@knowcode/doc-builder">
21
+ <meta property="og:locale" content="en_US">
22
+
23
+ <!-- Twitter Card -->
24
+ <meta name="twitter:card" content="summary_large_image">
25
+ <meta name="twitter:site" content="@planbbackups">
26
+ <meta name="twitter:creator" content="@planbbackups">
27
+ <meta name="twitter:title" content="Private Directory Authentication Guide">
28
+ <meta name="twitter:description" content="The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a `private`...">
29
+ <meta name="twitter:image" content="https://doc-builder-delta.vercel.app/og-default.png">
30
+
31
+ <!-- Custom Meta Tags -->
32
+ <meta name="google-site-verification" content="FtzcDTf5BQ9K5EfnGazQkgU2U4FiN3ITzM7gHwqUAqQ">
33
+ <meta name="msvalidate.01" content="B2D8C4C12C530D47AA962B24CAA09630">
34
+
35
+ <!-- Fonts -->
36
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
37
+
38
+ <!-- Icons -->
39
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
40
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/regular/style.css">
41
+
42
+ <!-- Mermaid -->
43
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
44
+
45
+ <!-- Styles -->
46
+ <link rel="stylesheet" href="/css/notion-style.css">
47
+
48
+
49
+ <!-- Hide content until auth check -->
50
+ <style>
51
+ body {
52
+ visibility: hidden;
53
+ opacity: 0;
54
+ transition: opacity 0.3s ease;
55
+ }
56
+ body.authenticated {
57
+ visibility: visible;
58
+ opacity: 1;
59
+ }
60
+ /* Show login/logout pages immediately */
61
+ body.auth-page {
62
+ visibility: visible;
63
+ opacity: 1;
64
+ }
65
+ /* Style auth button consistently */
66
+ .auth-btn {
67
+ background: none;
68
+ border: none;
69
+ color: var(--text-secondary);
70
+ cursor: pointer;
71
+ padding: 0.5rem;
72
+ border-radius: 0.5rem;
73
+ transition: all 0.2s;
74
+ font-size: 1.1rem;
75
+ }
76
+ .auth-btn:hover {
77
+ background: var(--bg-secondary);
78
+ color: var(--text-primary);
79
+ }
80
+ </style>
81
+
82
+
83
+ <!-- Favicon -->
84
+ <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>">
85
+
86
+ <script type="application/ld+json">
87
+ {
88
+ "@context": "https://schema.org",
89
+ "@type": "TechArticle",
90
+ "headline": "Private Directory Authentication Guide",
91
+ "description": "The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a `private`...",
92
+ "author": {
93
+ "@type": "Person",
94
+ "name": "Lindsay Smith"
95
+ },
96
+ "publisher": {
97
+ "@type": "Organization",
98
+ "name": "Knowcode Ltd",
99
+ "url": "https://knowcode.tech"
100
+ },
101
+ "datePublished": "2025-07-26T10:20:52.393Z",
102
+ "dateModified": "2025-07-26T10:20:52.393Z",
103
+ "mainEntityOfPage": {
104
+ "@type": "WebPage",
105
+ "@id": "https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html"
106
+ },
107
+ "breadcrumb": {
108
+ "@type": "BreadcrumbList",
109
+ "itemListElement": [
110
+ {
111
+ "@type": "ListItem",
112
+ "position": 1,
113
+ "name": "@knowcode/doc-builder",
114
+ "item": "https://doc-builder-delta.vercel.app"
115
+ },
116
+ {
117
+ "@type": "ListItem",
118
+ "position": 2,
119
+ "name": "Guides",
120
+ "item": "https://doc-builder-delta.vercel.app/guides/"
121
+ },
122
+ {
123
+ "@type": "ListItem",
124
+ "position": 3,
125
+ "name": "Private Directory Authentication",
126
+ "item": "https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html"
127
+ }
128
+ ]
129
+ }
130
+ }
131
+ </script>
132
+ </head>
133
+ <body>
134
+ <!-- Header -->
135
+ <header class="header">
136
+ <div class="header-content">
137
+ <a href="/index.html" class="logo">@knowcode/doc-builder</a>
138
+
139
+ <div class="header-actions">
140
+ <div class="deployment-info">
141
+ <span class="deployment-date" title="Built with doc-builder v1.8.0">Last updated: Jul 26, 2025, 10:20 AM UTC</span>
142
+ </div>
143
+
144
+
145
+ <a href="../../login.html" class="auth-btn" title="Login/Logout">
146
+ <i class="fas fa-sign-in-alt"></i>
147
+ </a>
148
+
149
+
150
+ <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
151
+ <i class="fas fa-moon"></i>
152
+ </button>
153
+
154
+ <button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
155
+ <i class="fas fa-bars"></i>
156
+ </button>
157
+ </div>
158
+ </div>
159
+ </header>
160
+
161
+ <!-- Preview Banner -->
162
+ <div id="preview-banner" class="preview-banner">
163
+ <div class="banner-content">
164
+ <i class="fas fa-exclamation-triangle banner-icon"></i>
165
+ <span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
166
+ <button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
167
+ <i class="fas fa-times"></i>
168
+ </button>
169
+ </div>
170
+ </div>
171
+
172
+ <!-- Breadcrumbs -->
173
+ <nav class="breadcrumbs" id="breadcrumbs">
174
+ <!-- Breadcrumbs will be generated by JavaScript -->
175
+ </nav>
176
+
177
+ <!-- Main Content -->
178
+ <div class="main-wrapper">
179
+ <!-- Sidebar -->
180
+ <aside class="sidebar">
181
+ <div class="sidebar-header">
182
+ <div class="filter-box">
183
+ <input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
184
+ <i class="fas fa-search filter-icon"></i>
185
+ </div>
186
+ </div>
187
+ <nav class="navigation">
188
+
189
+ <div class="nav-section" data-level="0">
190
+ <a class="nav-title" href="/README.html" >
191
+ <i class="fas fa-home"></i> Documentation
192
+ </a>
193
+ <div class="nav-content" >
194
+ <a href="/README.html" class="nav-item" data-tooltip="@knowcode/doc-builder."><i class="fas fa-file-alt"></i> Overview</a>
195
+ <a href="/documentation-index.html" class="nav-item" data-tooltip="This directory contains additional documentation for the @knowcode/doc-builder project, organized by topic and purpose."><i class="fas fa-file-alt"></i> Documentation Index</a>
196
+ <a href="/vercel-cli-setup-guide.html" class="nav-item" data-tooltip="This guide provides comprehensive instructions for installing the Vercel CLI across different operating systems."><i class="fas fa-file-alt"></i> Vercel Cli Setup Guide</a>
197
+ <a href="/vercel-first-time-setup-guide.html" class="nav-item" data-tooltip="This guide walks you through the Vercel deployment process when using ."><i class="fas fa-file-alt"></i> Vercel First Time Setup Guide</a></div></div>
198
+ <div class="nav-section" data-level="1">
199
+ <a class="nav-title collapsible expanded" href="#" data-target="nav-guides-1" >
200
+ <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Guides
201
+ </a>
202
+ <div class="nav-content" id="nav-guides-1">
203
+ <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="fas fa-file-alt"></i> Authentication Default Change</a>
204
+ <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="fas fa-file-alt"></i> Authentication Guide</a>
205
+ <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
206
+ <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
207
+ <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="fas fa-file-alt"></i> Phosphor Icons Guide</a>
208
+ <a href="/guides/private-directory-authentication.html" class="nav-item active" data-tooltip="The @knowcode/doc-builder provides flexible authentication options to protect your documentation."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
209
+ <a href="/guides/public-site-deployment.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="fas fa-file-alt"></i> Public Site Deployment</a>
210
+ <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="fas fa-file-alt"></i> Search Engine Verification Guide</a>
211
+ <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
212
+ <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features that automatically optimize your documentation for search..."><i class="fas fa-file-alt"></i> Seo Optimization Guide</a>
213
+ <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a>
214
+ <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="fas fa-file-alt"></i> Windows Setup Guide</a></div></div>
215
+ </nav>
216
+ <div class="resize-handle"></div>
217
+ </aside>
218
+
219
+ <!-- Content Area -->
220
+ <main class="content">
221
+ <div class="content-inner">
222
+ <h1>Private Directory Authentication Guide</h1>
223
+ <h2>Overview</h2>
224
+ <p>The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a <code>private</code> directory or secure your entire documentation site.</p>
225
+ <h2>Two Authentication Modes</h2>
226
+ <h3>1. Private Directory Mode (Mixed Public/Private)</h3>
227
+ <p>Create a <code>docs/private/</code> directory to automatically enable authentication for sensitive documents while keeping the rest of your documentation public.</p>
228
+ <p><strong>How it works:</strong></p>
229
+ <ul>
230
+ <li>Documents in <code>private/</code> folder require authentication</li>
231
+ <li>Documents outside <code>private/</code> remain publicly accessible</li>
232
+ <li>Login button appears in the header</li>
233
+ <li>Perfect for documentation with some sensitive content</li>
234
+ </ul>
235
+ <p><strong>Example structure:</strong></p>
236
+ <pre><code>docs/
237
+ ├── README.md # ✅ Public - Anyone can access
238
+ ├── getting-started.md # ✅ Public - Anyone can access
239
+ ├── guides/
240
+ │ ├── installation.md # ✅ Public - Anyone can access
241
+ │ └── usage.md # ✅ Public - Anyone can access
242
+ └── private/
243
+ ├── api-keys.md # 🔐 Private - Login required
244
+ ├── deployment.md # 🔐 Private - Login required
245
+ └── internal/
246
+ └── secrets.md # 🔐 Private - Login required
247
+ </code></pre>
248
+ <h3>2. Full Site Authentication Mode</h3>
249
+ <p>Make your entire documentation site private by setting authentication in your configuration file.</p>
250
+ <p><strong>How it works:</strong></p>
251
+ <ul>
252
+ <li>ALL documents require authentication</li>
253
+ <li>No public access whatsoever</li>
254
+ <li>Login required before viewing any page</li>
255
+ <li>Perfect for internal company documentation</li>
256
+ </ul>
257
+ <p><strong>Configuration:</strong></p>
258
+ <pre><code class="language-javascript">// doc-builder.config.js
259
+ module.exports = {
260
+ features: {
261
+ authentication: &#39;supabase&#39; // Entire site requires login
262
+ },
263
+ // ... other config
264
+ };
265
+ </code></pre>
266
+ <h2>How They Work Together</h2>
267
+ <p>If you have <strong>both</strong> a private directory AND set <code>authentication: &#39;supabase&#39;</code> in your config:</p>
268
+ <ul>
269
+ <li>The config setting takes precedence</li>
270
+ <li>The entire site becomes private (full authentication mode)</li>
271
+ <li>The private directory distinction becomes irrelevant since everything requires login</li>
272
+ </ul>
273
+ <h2>User Experience</h2>
274
+ <h3>Private Directory Mode</h3>
275
+ <p><strong>Unauthenticated users see:</strong></p>
276
+ <ul>
277
+ <li>Only public documents in navigation</li>
278
+ <li>Login button in header</li>
279
+ <li>Access to all public content</li>
280
+ <li>Redirect to login if trying to access private URLs</li>
281
+ </ul>
282
+ <p><strong>Authenticated users see:</strong></p>
283
+ <ul>
284
+ <li>Complete navigation including private folders</li>
285
+ <li>Logout button in header </li>
286
+ <li>Full access to all documentation</li>
287
+ <li>Seamless experience across public and private content</li>
288
+ </ul>
289
+ <h3>Full Site Mode</h3>
290
+ <p><strong>Everyone must:</strong></p>
291
+ <ul>
292
+ <li>Login before accessing any content</li>
293
+ <li>Authenticate to see navigation</li>
294
+ <li>Have valid credentials to view any page</li>
295
+ </ul>
296
+ <h2>Setting Up Supabase Authentication</h2>
297
+ <p>Both authentication modes use Supabase for secure user management. Here&#39;s how to configure it:</p>
298
+ <h3>1. Configure Credentials</h3>
299
+ <p>Add your Supabase credentials to <code>doc-builder.config.js</code>:</p>
300
+ <pre><code class="language-javascript">module.exports = {
301
+ auth: {
302
+ supabaseUrl: &#39;https://your-project.supabase.co&#39;,
303
+ supabaseAnonKey: &#39;your-anon-key&#39;,
304
+ siteId: &#39;your-site-id&#39; // Unique identifier for this doc site
305
+ }
306
+ };
307
+ </code></pre>
308
+ <h3>2. Create Access Control Table</h3>
309
+ <p>In your Supabase dashboard, run this SQL to create the access control table:</p>
310
+ <pre><code class="language-sql">CREATE TABLE docbuilder_access (
311
+ id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
312
+ user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
313
+ site_id TEXT NOT NULL,
314
+ created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
315
+ UNIQUE(user_id, site_id)
316
+ );
317
+ </code></pre>
318
+ <h3>3. Grant User Access</h3>
319
+ <p>Add authorized users by inserting records:</p>
320
+ <pre><code class="language-sql">-- First, create a user in Supabase Auth
321
+ -- Then grant them access to your documentation
322
+ INSERT INTO docbuilder_access (user_id, site_id)
323
+ VALUES (&#39;user-uuid-from-auth-users&#39;, &#39;your-site-id&#39;);
324
+ </code></pre>
325
+ <h3>What Happens Without Credentials?</h3>
326
+ <p>If you enable authentication (via private directory or config) without configuring Supabase:</p>
327
+ <ul>
328
+ <li>The login button still appears</li>
329
+ <li>Login page shows Supabase connection error</li>
330
+ <li>This reminds you to complete the configuration</li>
331
+ <li>Your documentation structure is ready, just needs credentials</li>
332
+ </ul>
333
+ <h2>Best Practices</h2>
334
+ <h3>Choosing the Right Mode</h3>
335
+ <p><strong>Use Private Directory Mode when:</strong></p>
336
+ <ul>
337
+ <li>Most documentation is public</li>
338
+ <li>Only specific sections need protection</li>
339
+ <li>You want easy public access to general docs</li>
340
+ <li>Examples: Open source projects with private contributor guides</li>
341
+ </ul>
342
+ <p><strong>Use Full Site Mode when:</strong></p>
343
+ <ul>
344
+ <li>All content is confidential</li>
345
+ <li>Documentation is for internal use only</li>
346
+ <li>You need maximum security</li>
347
+ <li>Examples: Company handbooks, internal APIs</li>
348
+ </ul>
349
+ <h3>Organizing Private Content</h3>
350
+ <p>Structure your private directory meaningfully:</p>
351
+ <pre><code>private/
352
+ ├── admin/ # Admin-only documentation
353
+ ├── api/ # Internal API docs
354
+ ├── deployment/ # Deployment procedures
355
+ ├── credentials/ # API keys and secrets
356
+ └── team/ # Team processes
357
+ </code></pre>
358
+ <h3>Security Features</h3>
359
+ <ol>
360
+ <li><strong>Build-Time Protection</strong>: Private files excluded from public navigation during build</li>
361
+ <li><strong>URL Protection</strong>: Direct access to private URLs redirects to login</li>
362
+ <li><strong>Session Management</strong>: Supabase handles secure sessions</li>
363
+ <li><strong>Access Control</strong>: Fine-grained permissions via database</li>
364
+ </ol>
365
+ <h3>Migration Strategies</h3>
366
+ <p><strong>Moving to Private Directory Mode:</strong></p>
367
+ <ol>
368
+ <li>Create <code>docs/private/</code> folder</li>
369
+ <li>Move sensitive documents into it</li>
370
+ <li>Update internal links if needed</li>
371
+ <li>Deploy - authentication automatically enabled</li>
372
+ </ol>
373
+ <p><strong>Moving to Full Site Mode:</strong></p>
374
+ <ol>
375
+ <li>Add <code>authentication: &#39;supabase&#39;</code> to config</li>
376
+ <li>Configure Supabase credentials</li>
377
+ <li>Deploy - entire site now requires login</li>
378
+ </ol>
379
+ <h2>Common Scenarios</h2>
380
+ <h3>Example 1: Open Source Project with Private Docs</h3>
381
+ <pre><code>docs/
382
+ ├── README.md # ✅ Public - Project overview
383
+ ├── contributing.md # ✅ Public - How to contribute
384
+ ├── api-reference.md # ✅ Public - API documentation
385
+ └── private/
386
+ ├── deployment.md # 🔐 Private - How to deploy
387
+ ├── api-keys.md # 🔐 Private - Production keys
388
+ └── maintenance.md # 🔐 Private - Admin procedures
389
+ </code></pre>
390
+ <p>Perfect for: Open source projects where most docs are public but deployment and admin info is private.</p>
391
+ <h3>Example 2: Company Documentation Portal</h3>
392
+ <pre><code class="language-javascript">// doc-builder.config.js
393
+ module.exports = {
394
+ features: {
395
+ authentication: &#39;supabase&#39; // Everything requires login
396
+ }
397
+ };
398
+ </code></pre>
399
+ <p>Perfect for: Internal company wikis where all content is confidential.</p>
400
+ <h3>Example 3: Client Documentation with Mixed Access</h3>
401
+ <pre><code>docs/
402
+ ├── getting-started.md # ✅ Public - Basic setup
403
+ ├── faq.md # ✅ Public - Common questions
404
+ ├── changelog.md # ✅ Public - Version history
405
+ └── private/
406
+ ├── advanced-config.md # 🔐 Private - Advanced setup
407
+ ├── troubleshooting.md # 🔐 Private - Debug guides
408
+ └── support-contacts.md # 🔐 Private - Direct contacts
409
+ </code></pre>
410
+ <p>Perfect for: SaaS products where basic docs are public but advanced guides require authentication.</p>
411
+ <h2>Quick Reference</h2>
412
+ <table>
413
+ <thead>
414
+ <tr>
415
+ <th>Feature</th>
416
+ <th>Private Directory Mode</th>
417
+ <th>Full Site Mode</th>
418
+ </tr>
419
+ </thead>
420
+ <tbody><tr>
421
+ <td><strong>Trigger</strong></td>
422
+ <td>Create <code>docs/private/</code> folder</td>
423
+ <td>Set <code>authentication: &#39;supabase&#39;</code> in config</td>
424
+ </tr>
425
+ <tr>
426
+ <td><strong>Public Access</strong></td>
427
+ <td>Yes, for non-private docs</td>
428
+ <td>No, everything requires login</td>
429
+ </tr>
430
+ <tr>
431
+ <td><strong>Use Case</strong></td>
432
+ <td>Mixed public/private content</td>
433
+ <td>Fully private documentation</td>
434
+ </tr>
435
+ <tr>
436
+ <td><strong>Configuration</strong></td>
437
+ <td>Zero config (just create folder)</td>
438
+ <td>One line in config file</td>
439
+ </tr>
440
+ <tr>
441
+ <td><strong>Login Button</strong></td>
442
+ <td>Shows when private folder exists</td>
443
+ <td>Shows when config enabled</td>
444
+ </tr>
445
+ </tbody></table>
446
+ <h2>Summary</h2>
447
+ <p>The @knowcode/doc-builder provides two simple ways to protect your documentation:</p>
448
+ <ol>
449
+ <li><strong>Private Directory</strong>: Just create a <code>private</code> folder for mixed public/private sites</li>
450
+ <li><strong>Full Authentication</strong>: Add one line to config for completely private sites</li>
451
+ </ol>
452
+ <p>Both approaches use the same secure Supabase authentication system, giving you flexibility to choose the right protection level for your documentation needs.</p>
453
+
454
+ </div>
455
+ </main>
456
+ </div>
457
+
458
+ <!-- Scripts -->
459
+ <script>
460
+ // Pass configuration to frontend
461
+ window.docBuilderConfig = {
462
+ features: {
463
+ showPdfDownload: true,
464
+ menuDefaultOpen: false
465
+ }
466
+ };
467
+ </script>
468
+ <script src="/js/main.js"></script>
469
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
470
+ <script src="/js/auth.js"></script>
471
+ </body>
472
+ </html>
@@ -46,6 +46,39 @@
46
46
  <link rel="stylesheet" href="/css/notion-style.css">
47
47
 
48
48
 
49
+ <!-- Hide content until auth check -->
50
+ <style>
51
+ body {
52
+ visibility: hidden;
53
+ opacity: 0;
54
+ transition: opacity 0.3s ease;
55
+ }
56
+ body.authenticated {
57
+ visibility: visible;
58
+ opacity: 1;
59
+ }
60
+ /* Show login/logout pages immediately */
61
+ body.auth-page {
62
+ visibility: visible;
63
+ opacity: 1;
64
+ }
65
+ /* Style auth button consistently */
66
+ .auth-btn {
67
+ background: none;
68
+ border: none;
69
+ color: var(--text-secondary);
70
+ cursor: pointer;
71
+ padding: 0.5rem;
72
+ border-radius: 0.5rem;
73
+ transition: all 0.2s;
74
+ font-size: 1.1rem;
75
+ }
76
+ .auth-btn:hover {
77
+ background: var(--bg-secondary);
78
+ color: var(--text-primary);
79
+ }
80
+ </style>
81
+
49
82
 
50
83
  <!-- Favicon -->
51
84
  <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>">
@@ -65,8 +98,8 @@
65
98
  "name": "Knowcode Ltd",
66
99
  "url": "https://knowcode.tech"
67
100
  },
68
- "datePublished": "2025-07-25T13:49:06.538Z",
69
- "dateModified": "2025-07-25T13:49:06.538Z",
101
+ "datePublished": "2025-07-26T10:20:52.394Z",
102
+ "dateModified": "2025-07-26T10:20:52.394Z",
70
103
  "mainEntityOfPage": {
71
104
  "@type": "WebPage",
72
105
  "@id": "https://doc-builder-delta.vercel.app/guides/public-site-deployment.html"
@@ -105,10 +138,14 @@
105
138
 
106
139
  <div class="header-actions">
107
140
  <div class="deployment-info">
108
- <span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
141
+ <span class="deployment-date" title="Built with doc-builder v1.8.0">Last updated: Jul 26, 2025, 10:20 AM UTC</span>
109
142
  </div>
110
143
 
111
144
 
145
+ <a href="../../login.html" class="auth-btn" title="Login/Logout">
146
+ <i class="fas fa-sign-in-alt"></i>
147
+ </a>
148
+
112
149
 
113
150
  <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
114
151
  <i class="fas fa-moon"></i>
@@ -164,31 +201,17 @@
164
201
  </a>
165
202
  <div class="nav-content" id="nav-guides-1">
166
203
  <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="fas fa-file-alt"></i> Authentication Default Change</a>
167
- <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="🚨 This authentication method has been REMOVED in version 2.0.0 due to serious security flaws."><i class="fas fa-file-alt"></i> Authentication Guide</a>
168
- <a href="/guides/cache-control-anti-pattern.html" class="nav-item" data-tooltip="Cache Control Anti-Pattern: Why Aggressive Cache-Busting is Bad for Documentation Sites."><i class="fas fa-file-alt"></i> Cache Control Anti Pattern</a>
204
+ <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="fas fa-file-alt"></i> Authentication Guide</a>
169
205
  <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
170
206
  <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
171
- <a href="/guides/next-steps-walkthrough.html" class="nav-item" data-tooltip="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment."><i class="fas fa-file-alt"></i> Next Steps Walkthrough</a>
172
207
  <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="fas fa-file-alt"></i> Phosphor Icons Guide</a>
208
+ <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder provides flexible authentication options to protect your documentation."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
173
209
  <a href="/guides/public-site-deployment.html" class="nav-item active" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="fas fa-file-alt"></i> Public Site Deployment</a>
174
210
  <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="fas fa-file-alt"></i> Search Engine Verification Guide</a>
175
211
  <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
176
212
  <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features that automatically optimize your documentation for search..."><i class="fas fa-file-alt"></i> Seo Optimization Guide</a>
177
- <a href="/guides/supabase-auth-implementation-plan.html" class="nav-item" data-tooltip="Supabase Auth Implementation Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Plan</a>
178
- <a href="/guides/supabase-auth-integration-plan.html" class="nav-item" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Integration Plan</a>
179
- <a href="/guides/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder now supports enterprise-grade authentication through Supabase, replacing the previous insecure basic authentication."><i class="fas fa-file-alt"></i> Supabase Auth Setup Guide</a>
180
213
  <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a>
181
- <a href="/guides/vercel-deployment-auth-setup.html" class="nav-item" data-tooltip="Vercel Deployment Authentication Setup Guide."><i class="fas fa-file-alt"></i> Vercel Deployment Auth Setup</a>
182
214
  <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="fas fa-file-alt"></i> Windows Setup Guide</a></div></div>
183
- <div class="nav-section" data-level="1">
184
- <a class="nav-title collapsible" href="/launch/README.html" data-target="nav-launch-1" >
185
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Launch
186
- </a>
187
- <div class="nav-content collapsed" id="nav-launch-1">
188
- <a href="/launch/README.html" class="nav-item" data-tooltip="This directory contains all documentation related to the commercial launch of @knowcode/doc-builder, including go-to-market strategy, platform..."><i class="fas fa-file-alt"></i> Launch Overview</a>
189
- <a href="/launch/bubble-plugin-specification.html" class="nav-item" data-tooltip="This document outlines the technical specification for creating a Bubble.io plugin that integrates @knowcode/doc-builder, enabling Bubble developers..."><i class="fas fa-file-alt"></i> Bubble Plugin Specification</a>
190
- <a href="/launch/go-to-market-strategy.html" class="nav-item" data-tooltip="Go-to-Market Strategy &amp; Product Launch Plan."><i class="fas fa-file-alt"></i> Go To Market Strategy</a>
191
- <a href="/launch/launch-announcements.html" class="nav-item" data-tooltip="This document contains ready-to-use announcement templates for launching @knowcode/doc-builder across various platforms and channels."><i class="fas fa-file-alt"></i> Launch Announcements</a></div></div>
192
215
  </nav>
193
216
  <div class="resize-handle"></div>
194
217
  </aside>
@@ -311,14 +334,15 @@ npx @knowcode/doc-builder deploy -c public-config.js
311
334
  <h3>3. Clear Documentation</h3>
312
335
  <p>Always indicate whether documentation is public or requires authentication in your README or landing page.</p>
313
336
  <h2>Migration Guide</h2>
314
- <h3>From Basic Auth to Public</h3>
315
- <p>If you were using basic authentication and want to make your site public:</p>
337
+ <h3>From Authenticated to Public</h3>
338
+ <p>If you were using Supabase authentication and want to make your site public:</p>
316
339
  <ol>
317
- <li><p><strong>Remove old auth config</strong>:</p>
340
+ <li><p><strong>Remove auth config</strong>:</p>
318
341
  <pre><code class="language-javascript">// Remove this:
319
342
  auth: {
320
- username: &#39;admin&#39;,
321
- password: &#39;secret&#39;
343
+ supabaseUrl: &#39;https://xxx.supabase.co&#39;,
344
+ supabaseAnonKey: &#39;xxx&#39;,
345
+ siteId: &#39;xxx&#39;
322
346
  }
323
347
  </code></pre>
324
348
  </li>
@@ -358,6 +382,7 @@ auth: {
358
382
  };
359
383
  </script>
360
384
  <script src="/js/main.js"></script>
361
-
385
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
386
+ <script src="/js/auth.js"></script>
362
387
  </body>
363
388
  </html>