@knowcode/doc-builder 1.8.0 → 1.8.2

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 (49) hide show
  1. package/.claude/settings.local.json +4 -1
  2. package/CHANGELOG.md +24 -0
  3. package/assets/js/main.js +10 -6
  4. package/html/README.html +43 -5
  5. package/html/auth.js +61 -12
  6. package/html/documentation-index.html +43 -5
  7. package/html/guides/authentication-default-change.html +43 -5
  8. package/html/guides/authentication-guide.html +50 -9
  9. package/html/guides/claude-workflow-guide.html +43 -5
  10. package/html/guides/documentation-standards.html +43 -5
  11. package/html/guides/phosphor-icons-guide.html +43 -5
  12. package/html/guides/private-directory-authentication.html +246 -119
  13. package/html/guides/public-site-deployment.html +43 -5
  14. package/html/guides/search-engine-verification-guide.html +43 -5
  15. package/html/guides/seo-guide.html +43 -5
  16. package/html/guides/seo-optimization-guide.html +43 -5
  17. package/html/guides/troubleshooting-guide.html +43 -5
  18. package/html/guides/windows-setup-guide.html +43 -5
  19. package/html/index.html +43 -5
  20. package/html/js/auth.js +118 -39
  21. package/html/js/main.js +10 -6
  22. package/html/login.html +3 -3
  23. package/html/logout.html +2 -2
  24. package/html/private/cache-control-anti-pattern.html +67 -5
  25. package/html/private/launch/README.html +67 -5
  26. package/html/private/launch/auth-cleanup-summary.html +67 -5
  27. package/html/private/launch/bubble-plugin-specification.html +67 -5
  28. package/html/private/launch/go-to-market-strategy.html +67 -5
  29. package/html/private/launch/launch-announcements.html +67 -5
  30. package/html/private/launch/vercel-deployment-auth-setup.html +67 -5
  31. package/html/private/next-steps-walkthrough.html +67 -5
  32. package/html/private/supabase-auth-implementation-completed.html +67 -5
  33. package/html/private/supabase-auth-implementation-plan.html +67 -5
  34. package/html/private/supabase-auth-integration-plan.html +67 -5
  35. package/html/private/supabase-auth-setup-guide.html +67 -5
  36. package/html/private/test-private-doc.html +67 -5
  37. package/html/private/user-management-tooling.html +587 -0
  38. package/html/robots.txt +4 -0
  39. package/html/sitemap.xml +49 -43
  40. package/html/vercel-cli-setup-guide.html +43 -5
  41. package/html/vercel-first-time-setup-guide.html +43 -5
  42. package/lib/config.js +20 -27
  43. package/lib/core-builder.js +9 -1
  44. package/lib/shared-auth-config.js +21 -0
  45. package/lib/supabase-auth.js +20 -14
  46. package/package.json +1 -1
  47. package/user-management/README.md +280 -51
  48. package/user-management/add-users.sh +661 -262
  49. package/user-management/create-user.js +65 -0
@@ -3,11 +3,11 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta name="description" content="The @knowcode/doc-builder now includes automatic authentication for documents placed in a `private` directory. This feature provides a simple,...">
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
7
  <title>Private Directory Authentication Guide</title>
8
8
 
9
9
  <meta name="author" content="Lindsay Smith">
10
- <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, private, directory">
10
+ <meta name="keywords" content="documentation, markdown, static site generator, vercel, notion-style, private, authentication">
11
11
  <meta name="robots" content="index, follow">
12
12
  <link rel="canonical" href="https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html">
13
13
 
@@ -15,7 +15,7 @@
15
15
  <meta property="og:type" content="article">
16
16
  <meta property="og:url" content="https://doc-builder-delta.vercel.app/guides/private-directory-authentication.html">
17
17
  <meta property="og:title" content="Private Directory Authentication Guide">
18
- <meta property="og:description" content="The @knowcode/doc-builder now includes automatic authentication for documents placed in a `private` directory. This feature provides a simple,...">
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
19
  <meta property="og:image" content="https://doc-builder-delta.vercel.app/og-default.png">
20
20
  <meta property="og:site_name" content="@knowcode/doc-builder">
21
21
  <meta property="og:locale" content="en_US">
@@ -25,7 +25,7 @@
25
25
  <meta name="twitter:site" content="@planbbackups">
26
26
  <meta name="twitter:creator" content="@planbbackups">
27
27
  <meta name="twitter:title" content="Private Directory Authentication Guide">
28
- <meta name="twitter:description" content="The @knowcode/doc-builder now includes automatic authentication for documents placed in a `private` directory. This feature provides a simple,...">
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
29
  <meta name="twitter:image" content="https://doc-builder-delta.vercel.app/og-default.png">
30
30
 
31
31
  <!-- Custom Meta Tags -->
@@ -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>">
@@ -55,7 +88,7 @@
55
88
  "@context": "https://schema.org",
56
89
  "@type": "TechArticle",
57
90
  "headline": "Private Directory Authentication Guide",
58
- "description": "The @knowcode/doc-builder now includes automatic authentication for documents placed in a `private` directory. This feature provides a simple,...",
91
+ "description": "The @knowcode/doc-builder provides flexible authentication options to protect your documentation. You can either protect specific documents using a `private`...",
59
92
  "author": {
60
93
  "@type": "Person",
61
94
  "name": "Lindsay Smith"
@@ -65,8 +98,8 @@
65
98
  "name": "Knowcode Ltd",
66
99
  "url": "https://knowcode.tech"
67
100
  },
68
- "datePublished": "2025-07-26T09:59:22.958Z",
69
- "dateModified": "2025-07-26T09:59:22.958Z",
101
+ "datePublished": "2025-07-26T10:38:41.982Z",
102
+ "dateModified": "2025-07-26T10:38:41.982Z",
70
103
  "mainEntityOfPage": {
71
104
  "@type": "WebPage",
72
105
  "@id": "https://doc-builder-delta.vercel.app/guides/private-directory-authentication.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.8.0">Last updated: Jul 26, 2025, 09:59 AM UTC</span>
141
+ <span class="deployment-date" title="Built with doc-builder v1.8.1">Last updated: Jul 26, 2025, 10:38 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>
@@ -168,7 +205,7 @@
168
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>
169
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>
170
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>
171
- <a href="/guides/private-directory-authentication.html" class="nav-item active" data-tooltip="The @knowcode/doc-builder now includes automatic authentication for documents placed in a directory."><i class="fas fa-file-alt"></i> Private Directory Authentication</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>
172
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>
173
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>
174
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>
@@ -184,58 +221,94 @@
184
221
  <div class="content-inner">
185
222
  <h1>Private Directory Authentication Guide</h1>
186
223
  <h2>Overview</h2>
187
- <p>The @knowcode/doc-builder now includes automatic authentication for documents placed in a <code>private</code> directory. This feature provides a simple, convention-based approach to protecting sensitive documentation without requiring complex configuration.</p>
188
- <h2>How It Works</h2>
189
- <h3>Automatic Detection</h3>
190
- <p>When the doc-builder detects a <code>docs/private/</code> directory during the build process, it automatically:</p>
191
- <ol>
192
- <li>Enables Supabase authentication for the entire site</li>
193
- <li>Hides all private documents from unauthenticated users</li>
194
- <li>Shows a login button in the header</li>
195
- <li>Requires authentication to access any document in the private directory</li>
196
- </ol>
197
- <h3>Zero Configuration</h3>
198
- <p>Simply create a <code>private</code> folder in your docs directory:</p>
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>
199
236
  <pre><code>docs/
200
- ├── README.md # Public documentation
201
- ├── guides/ # Public guides
202
- │ └── setup.md
203
- └── private/ # 🔐 Protected documents
204
- ├── api-keys.md
205
- ├── internal/
206
- │ └── architecture.md
207
- └── team-notes.md
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
208
247
  </code></pre>
209
- <p>That&#39;s it! No configuration changes needed.</p>
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 authentication in your config:</p>
268
+ <ul>
269
+ <li>The private directory <strong>always</strong> triggers authentication (for security)</li>
270
+ <li>Setting <code>authentication: &#39;supabase&#39;</code> makes the entire site private</li>
271
+ <li>Setting <code>authentication: false</code> is overridden by private directory presence</li>
272
+ <li>This ensures private content is never accidentally exposed</li>
273
+ </ul>
210
274
  <h2>User Experience</h2>
211
- <h3>For Unauthenticated Users</h3>
275
+ <h3>Private Directory Mode</h3>
276
+ <p><strong>Unauthenticated users see:</strong></p>
212
277
  <ul>
213
- <li>Private documents are completely invisible in the navigation menu</li>
214
- <li>Attempting to access a private URL directly redirects to login</li>
215
- <li>Only public documentation is shown</li>
216
- <li>Login icon appears in the header</li>
278
+ <li>Only public documents in navigation</li>
279
+ <li>Login button in header</li>
280
+ <li>Access to all public content</li>
281
+ <li>Redirect to login if trying to access private URLs</li>
217
282
  </ul>
218
- <h3>For Authenticated Users</h3>
283
+ <p><strong>Authenticated users see:</strong></p>
219
284
  <ul>
220
- <li>Full navigation menu including private documents</li>
221
- <li>Seamless access to all documentation</li>
222
- <li>Logout icon replaces login icon in header</li>
223
- <li>No visual distinction between public and private docs</li>
285
+ <li>Complete navigation including private folders</li>
286
+ <li>Logout button in header </li>
287
+ <li>Full access to all documentation</li>
288
+ <li>Seamless experience across public and private content</li>
224
289
  </ul>
225
- <h2>Setting Up Authentication</h2>
226
- <p>While the private directory triggers authentication automatically, you still need to configure Supabase credentials:</p>
227
- <h3>1. Configure Supabase</h3>
228
- <p>In your <code>doc-builder.config.js</code>:</p>
290
+ <h3>Full Site Mode</h3>
291
+ <p><strong>Everyone must:</strong></p>
292
+ <ul>
293
+ <li>Login before accessing any content</li>
294
+ <li>Authenticate to see navigation</li>
295
+ <li>Have valid credentials to view any page</li>
296
+ </ul>
297
+ <h2>Setting Up Supabase Authentication</h2>
298
+ <p>Both authentication modes use Supabase for secure user management. Here&#39;s how to configure it:</p>
299
+ <h3>1. Credentials Are Automatic! (v1.8.2+)</h3>
300
+ <p>No need to configure credentials anymore! The shared Supabase database is automatically configured. Each site gets a unique auto-generated site ID during build.</p>
301
+ <p>To override with custom credentials (optional):</p>
229
302
  <pre><code class="language-javascript">module.exports = {
230
303
  auth: {
231
- supabaseUrl: &#39;https://your-project.supabase.co&#39;,
232
- supabaseAnonKey: &#39;your-anon-key&#39;,
233
- siteId: &#39;your-site-id&#39;
304
+ supabaseUrl: &#39;https://your-project.supabase.co&#39;, // Optional override
305
+ supabaseAnonKey: &#39;your-anon-key&#39;, // Optional override
306
+ siteId: &#39;your-site-id&#39; // Optional custom ID
234
307
  }
235
308
  };
236
309
  </code></pre>
237
- <h3>2. Set Up Database Access</h3>
238
- <p>Create the <code>docbuilder_access</code> table in Supabase:</p>
310
+ <h3>2. Create Access Control Table</h3>
311
+ <p>In your Supabase dashboard, run this SQL to create the access control table:</p>
239
312
  <pre><code class="language-sql">CREATE TABLE docbuilder_access (
240
313
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
241
314
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
@@ -245,92 +318,145 @@
245
318
  );
246
319
  </code></pre>
247
320
  <h3>3. Grant User Access</h3>
248
- <p>Add users to your site:</p>
249
- <pre><code class="language-sql">INSERT INTO docbuilder_access (user_id, site_id)
250
- VALUES (&#39;user-uuid-here&#39;, &#39;your-site-id&#39;);
321
+ <p>Add authorized users by inserting records:</p>
322
+ <pre><code class="language-sql">-- First, create a user in Supabase Auth
323
+ -- Then grant them access to your documentation
324
+ INSERT INTO docbuilder_access (user_id, site_id)
325
+ VALUES (&#39;user-uuid-from-auth-users&#39;, &#39;your-site-id&#39;);
326
+ </code></pre>
327
+ <h3>Automatic Credential Configuration</h3>
328
+ <p>Starting from version 1.8.2, Supabase credentials are automatically configured:</p>
329
+ <ul>
330
+ <li>All doc-builder sites share the same Supabase authentication database</li>
331
+ <li>Credentials are built into the package - no manual configuration needed</li>
332
+ <li>Each site gets a unique auto-generated site ID</li>
333
+ <li>You just need to add the site ID to the database to grant user access</li>
334
+ </ul>
335
+ <p><strong>Note</strong>: The auto-generated site ID is displayed during build:</p>
336
+ <pre><code>🔐 Found private directory - automatically enabling Supabase authentication
337
+ 📋 Generated site ID: documentation-1753525200000-abc123
338
+ Note: Add this site ID to your Supabase database to enable user access
251
339
  </code></pre>
252
340
  <h2>Best Practices</h2>
341
+ <h3>Choosing the Right Mode</h3>
342
+ <p><strong>Use Private Directory Mode when:</strong></p>
343
+ <ul>
344
+ <li>Most documentation is public</li>
345
+ <li>Only specific sections need protection</li>
346
+ <li>You want easy public access to general docs</li>
347
+ <li>Examples: Open source projects with private contributor guides</li>
348
+ </ul>
349
+ <p><strong>Use Full Site Mode when:</strong></p>
350
+ <ul>
351
+ <li>All content is confidential</li>
352
+ <li>Documentation is for internal use only</li>
353
+ <li>You need maximum security</li>
354
+ <li>Examples: Company handbooks, internal APIs</li>
355
+ </ul>
253
356
  <h3>Organizing Private Content</h3>
254
- <p>Structure your private directory logically:</p>
357
+ <p>Structure your private directory meaningfully:</p>
255
358
  <pre><code>private/
256
359
  ├── admin/ # Admin-only documentation
257
- ├── api/ # Internal API docs
258
- ├── deployment/ # Deployment guides
259
- ├── keys-and-secrets/ # Sensitive configurations
260
- └── team/ # Team-specific docs
360
+ ├── api/ # Internal API docs
361
+ ├── deployment/ # Deployment procedures
362
+ ├── credentials/ # API keys and secrets
363
+ └── team/ # Team processes
261
364
  </code></pre>
262
- <h3>Security Considerations</h3>
365
+ <h3>Security Features</h3>
263
366
  <ol>
264
- <li><strong>Complete Isolation</strong>: Private documents are never sent to unauthenticated users</li>
265
- <li><strong>No Partial Access</strong>: Users either see all private docs or none</li>
266
- <li><strong>Server-Side Protection</strong>: Navigation filtering happens during build time</li>
267
- <li><strong>Client-Side Verification</strong>: Additional checks on the client prevent unauthorized access</li>
367
+ <li><strong>Build-Time Protection</strong>: Private files excluded from public navigation during build</li>
368
+ <li><strong>URL Protection</strong>: Direct access to private URLs redirects to login</li>
369
+ <li><strong>Session Management</strong>: Supabase handles secure sessions</li>
370
+ <li><strong>Access Control</strong>: Fine-grained permissions via database</li>
268
371
  </ol>
269
- <h3>Migration Tips</h3>
270
- <p>If you have existing documentation:</p>
372
+ <h3>Migration Strategies</h3>
373
+ <p><strong>Moving to Private Directory Mode:</strong></p>
271
374
  <ol>
272
- <li>Identify sensitive documents</li>
273
- <li>Move them to the <code>private/</code> directory</li>
274
- <li>Update any internal links</li>
275
- <li>Rebuild and deploy</li>
375
+ <li>Create <code>docs/private/</code> folder</li>
376
+ <li>Move sensitive documents into it</li>
377
+ <li>Update internal links if needed</li>
378
+ <li>Deploy - authentication automatically enabled</li>
276
379
  </ol>
277
- <h2>Examples</h2>
278
- <h3>Simple Private Document</h3>
279
- <p>Create <code>docs/private/api-keys.md</code>:</p>
280
- <pre><code class="language-markdown"># API Keys and Secrets
281
-
282
- ## Production Keys
283
-
284
- - API Gateway: `sk_live_...`
285
- - Database: `postgres://...`
286
- - Third-party service: `...`
380
+ <p><strong>Moving to Full Site Mode:</strong></p>
381
+ <ol>
382
+ <li>Add <code>authentication: &#39;supabase&#39;</code> to config</li>
383
+ <li>Configure Supabase credentials</li>
384
+ <li>Deploy - entire site now requires login</li>
385
+ </ol>
386
+ <h2>Common Scenarios</h2>
387
+ <h3>Example 1: Open Source Project with Private Docs</h3>
388
+ <pre><code>docs/
389
+ ├── README.md # ✅ Public - Project overview
390
+ ├── contributing.md # ✅ Public - How to contribute
391
+ ├── api-reference.md # ✅ Public - API documentation
392
+ └── private/
393
+ ├── deployment.md # 🔐 Private - How to deploy
394
+ ├── api-keys.md # 🔐 Private - Production keys
395
+ └── maintenance.md # 🔐 Private - Admin procedures
287
396
  </code></pre>
288
- <p>This document will only be visible to authenticated users.</p>
289
- <h3>Mixed Public/Private Structure</h3>
397
+ <p>Perfect for: Open source projects where most docs are public but deployment and admin info is private.</p>
398
+ <h3>Example 2: Company Documentation Portal</h3>
399
+ <pre><code class="language-javascript">// doc-builder.config.js
400
+ module.exports = {
401
+ features: {
402
+ authentication: &#39;supabase&#39; // Everything requires login
403
+ }
404
+ };
405
+ </code></pre>
406
+ <p>Perfect for: Internal company wikis where all content is confidential.</p>
407
+ <h3>Example 3: Client Documentation with Mixed Access</h3>
290
408
  <pre><code>docs/
291
- ├── README.md # ✅ Public
292
- ├── guides/
293
- ├── getting-started.md # ✅ Public
294
- │ └── troubleshooting.md # ✅ Public
295
- ├── api/
296
- │ ├── overview.md # ✅ Public
297
- │ └── endpoints.md # ✅ Public
409
+ ├── getting-started.md # ✅ Public - Basic setup
410
+ ├── faq.md # ✅ Public - Common questions
411
+ ├── changelog.md # ✅ Public - Version history
298
412
  └── private/
299
- ├── deployment-guide.md # 🔐 Private
300
- ├── internal-api.md # 🔐 Private
301
- └── team/
302
- ├── onboarding.md # 🔐 Private
303
- └── processes.md # 🔐 Private
413
+ ├── advanced-config.md # 🔐 Private - Advanced setup
414
+ ├── troubleshooting.md # 🔐 Private - Debug guides
415
+ └── support-contacts.md # 🔐 Private - Direct contacts
304
416
  </code></pre>
305
- <h2>Troubleshooting</h2>
306
- <h3>Private Directory Not Detected</h3>
307
- <p>Ensure your private directory is directly under the docs folder:</p>
308
- <ul>
309
- <li><i class="ph ph-check-circle" aria-label="checked"></i> <code>docs/private/</code></li>
310
- <li><i class="ph ph-x-circle" aria-label="error"></i> <code>docs/guides/private/</code></li>
311
- </ul>
312
- <h3>Authentication Not Working</h3>
313
- <p>Check the console for messages:</p>
314
- <ul>
315
- <li>&quot;<i class="ph ph-lock-key" aria-label="secure"></i> Found private directory - automatically enabling Supabase authentication&quot;</li>
316
- <li>&quot;<i class="ph ph-warning-circle" aria-label="warning"></i> Supabase credentials not configured&quot;</li>
317
- </ul>
318
- <h3>Users Can&#39;t Access Private Docs</h3>
319
- <p>Verify:</p>
320
- <ol>
321
- <li>User exists in Supabase Auth</li>
322
- <li>User has entry in <code>docbuilder_access</code> table</li>
323
- <li><code>site_id</code> matches your configuration</li>
324
- </ol>
417
+ <p>Perfect for: SaaS products where basic docs are public but advanced guides require authentication.</p>
418
+ <h2>Quick Reference</h2>
419
+ <table>
420
+ <thead>
421
+ <tr>
422
+ <th>Feature</th>
423
+ <th>Private Directory Mode</th>
424
+ <th>Full Site Mode</th>
425
+ </tr>
426
+ </thead>
427
+ <tbody><tr>
428
+ <td><strong>Trigger</strong></td>
429
+ <td>Create <code>docs/private/</code> folder</td>
430
+ <td>Set <code>authentication: &#39;supabase&#39;</code> in config</td>
431
+ </tr>
432
+ <tr>
433
+ <td><strong>Public Access</strong></td>
434
+ <td>Yes, for non-private docs</td>
435
+ <td>No, everything requires login</td>
436
+ </tr>
437
+ <tr>
438
+ <td><strong>Use Case</strong></td>
439
+ <td>Mixed public/private content</td>
440
+ <td>Fully private documentation</td>
441
+ </tr>
442
+ <tr>
443
+ <td><strong>Configuration</strong></td>
444
+ <td>Zero config (just create folder)</td>
445
+ <td>One line in config file</td>
446
+ </tr>
447
+ <tr>
448
+ <td><strong>Login Button</strong></td>
449
+ <td>Shows when private folder exists</td>
450
+ <td>Shows when config enabled</td>
451
+ </tr>
452
+ </tbody></table>
325
453
  <h2>Summary</h2>
326
- <p>The private directory feature provides the simplest way to protect sensitive documentation:</p>
454
+ <p>The @knowcode/doc-builder provides two simple ways to protect your documentation:</p>
327
455
  <ol>
328
- <li>Create <code>docs/private/</code> directory</li>
329
- <li>Put sensitive docs inside</li>
330
- <li>Configure Supabase credentials</li>
331
- <li>Deploy</li>
456
+ <li><strong>Private Directory</strong>: Just create a <code>private</code> folder for mixed public/private sites</li>
457
+ <li><strong>Full Authentication</strong>: Add one line to config for completely private sites</li>
332
458
  </ol>
333
- <p>No complex configuration, no manual setup - just organize your files and go!</p>
459
+ <p>Both approaches use the same secure Supabase authentication system, giving you flexibility to choose the right protection level for your documentation needs.</p>
334
460
 
335
461
  </div>
336
462
  </main>
@@ -347,6 +473,7 @@ VALUES (&#39;user-uuid-here&#39;, &#39;your-site-id&#39;);
347
473
  };
348
474
  </script>
349
475
  <script src="/js/main.js"></script>
350
-
476
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
477
+ <script src="/js/auth.js"></script>
351
478
  </body>
352
479
  </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-26T09:59:22.960Z",
69
- "dateModified": "2025-07-26T09:59:22.960Z",
101
+ "datePublished": "2025-07-26T10:38:41.983Z",
102
+ "dateModified": "2025-07-26T10:38:41.983Z",
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.8.0">Last updated: Jul 26, 2025, 09:59 AM UTC</span>
141
+ <span class="deployment-date" title="Built with doc-builder v1.8.1">Last updated: Jul 26, 2025, 10:38 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>
@@ -168,7 +205,7 @@
168
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>
169
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>
170
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>
171
- <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now includes automatic authentication for documents placed in a directory."><i class="fas fa-file-alt"></i> Private Directory Authentication</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>
172
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>
173
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>
174
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>
@@ -345,6 +382,7 @@ auth: {
345
382
  };
346
383
  </script>
347
384
  <script src="/js/main.js"></script>
348
-
385
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
386
+ <script src="/js/auth.js"></script>
349
387
  </body>
350
388
  </html>