@knowcode/doc-builder 1.8.0 → 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 (47) hide show
  1. package/.claude/settings.local.json +4 -1
  2. package/CHANGELOG.md +7 -0
  3. package/assets/js/main.js +10 -6
  4. package/html/README.html +43 -5
  5. package/html/auth.js +62 -13
  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 +43 -5
  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 +237 -117
  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 +4 -4
  23. package/html/logout.html +2 -2
  24. package/html/private/cache-control-anti-pattern.html +66 -5
  25. package/html/private/launch/README.html +66 -5
  26. package/html/private/launch/auth-cleanup-summary.html +66 -5
  27. package/html/private/launch/bubble-plugin-specification.html +66 -5
  28. package/html/private/launch/go-to-market-strategy.html +66 -5
  29. package/html/private/launch/launch-announcements.html +66 -5
  30. package/html/private/launch/vercel-deployment-auth-setup.html +66 -5
  31. package/html/private/next-steps-walkthrough.html +66 -5
  32. package/html/private/supabase-auth-implementation-completed.html +66 -5
  33. package/html/private/supabase-auth-implementation-plan.html +66 -5
  34. package/html/private/supabase-auth-integration-plan.html +66 -5
  35. package/html/private/supabase-auth-setup-guide.html +66 -5
  36. package/html/private/test-private-doc.html +66 -5
  37. package/html/robots.txt +4 -0
  38. package/html/sitemap.xml +43 -43
  39. package/html/vercel-cli-setup-guide.html +43 -5
  40. package/html/vercel-first-time-setup-guide.html +43 -5
  41. package/lib/config.js +15 -21
  42. package/lib/core-builder.js +9 -1
  43. package/lib/supabase-auth.js +20 -14
  44. package/package.json +1 -1
  45. package/user-management/README.md +276 -51
  46. package/user-management/add-users.sh +635 -262
  47. 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:20:52.393Z",
102
+ "dateModified": "2025-07-26T10:20:52.393Z",
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.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>
@@ -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,92 @@
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 <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>
210
273
  <h2>User Experience</h2>
211
- <h3>For Unauthenticated Users</h3>
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>
212
283
  <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>
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>
217
288
  </ul>
218
- <h3>For Authenticated Users</h3>
289
+ <h3>Full Site Mode</h3>
290
+ <p><strong>Everyone must:</strong></p>
219
291
  <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>
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>
224
295
  </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>
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>
229
300
  <pre><code class="language-javascript">module.exports = {
230
301
  auth: {
231
302
  supabaseUrl: &#39;https://your-project.supabase.co&#39;,
232
303
  supabaseAnonKey: &#39;your-anon-key&#39;,
233
- siteId: &#39;your-site-id&#39;
304
+ siteId: &#39;your-site-id&#39; // Unique identifier for this doc site
234
305
  }
235
306
  };
236
307
  </code></pre>
237
- <h3>2. Set Up Database Access</h3>
238
- <p>Create the <code>docbuilder_access</code> table in Supabase:</p>
308
+ <h3>2. Create Access Control Table</h3>
309
+ <p>In your Supabase dashboard, run this SQL to create the access control table:</p>
239
310
  <pre><code class="language-sql">CREATE TABLE docbuilder_access (
240
311
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
241
312
  user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
@@ -245,92 +316,140 @@
245
316
  );
246
317
  </code></pre>
247
318
  <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;);
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;);
251
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>
252
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>
253
349
  <h3>Organizing Private Content</h3>
254
- <p>Structure your private directory logically:</p>
350
+ <p>Structure your private directory meaningfully:</p>
255
351
  <pre><code>private/
256
352
  ├── admin/ # Admin-only documentation
257
- ├── api/ # Internal API docs
258
- ├── deployment/ # Deployment guides
259
- ├── keys-and-secrets/ # Sensitive configurations
260
- └── team/ # Team-specific docs
353
+ ├── api/ # Internal API docs
354
+ ├── deployment/ # Deployment procedures
355
+ ├── credentials/ # API keys and secrets
356
+ └── team/ # Team processes
261
357
  </code></pre>
262
- <h3>Security Considerations</h3>
358
+ <h3>Security Features</h3>
263
359
  <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>
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>
268
364
  </ol>
269
- <h3>Migration Tips</h3>
270
- <p>If you have existing documentation:</p>
365
+ <h3>Migration Strategies</h3>
366
+ <p><strong>Moving to Private Directory Mode:</strong></p>
271
367
  <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>
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>
276
372
  </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: `...`
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
287
389
  </code></pre>
288
- <p>This document will only be visible to authenticated users.</p>
289
- <h3>Mixed Public/Private Structure</h3>
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>
290
401
  <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
402
+ ├── getting-started.md # ✅ Public - Basic setup
403
+ ├── faq.md # ✅ Public - Common questions
404
+ ├── changelog.md # ✅ Public - Version history
298
405
  └── private/
299
- ├── deployment-guide.md # 🔐 Private
300
- ├── internal-api.md # 🔐 Private
301
- └── team/
302
- ├── onboarding.md # 🔐 Private
303
- └── processes.md # 🔐 Private
406
+ ├── advanced-config.md # 🔐 Private - Advanced setup
407
+ ├── troubleshooting.md # 🔐 Private - Debug guides
408
+ └── support-contacts.md # 🔐 Private - Direct contacts
304
409
  </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>
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>
325
446
  <h2>Summary</h2>
326
- <p>The private directory feature provides the simplest way to protect sensitive documentation:</p>
447
+ <p>The @knowcode/doc-builder provides two simple ways to protect your documentation:</p>
327
448
  <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>
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>
332
451
  </ol>
333
- <p>No complex configuration, no manual setup - just organize your files and go!</p>
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>
334
453
 
335
454
  </div>
336
455
  </main>
@@ -347,6 +466,7 @@ VALUES (&#39;user-uuid-here&#39;, &#39;your-site-id&#39;);
347
466
  };
348
467
  </script>
349
468
  <script src="/js/main.js"></script>
350
-
469
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
470
+ <script src="/js/auth.js"></script>
351
471
  </body>
352
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-26T09:59:22.960Z",
69
- "dateModified": "2025-07-26T09:59:22.960Z",
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.8.0">Last updated: Jul 26, 2025, 09:59 AM 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>
@@ -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>