@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.
- package/.claude/settings.local.json +4 -1
- package/CHANGELOG.md +24 -0
- package/assets/js/main.js +10 -6
- package/html/README.html +43 -5
- package/html/auth.js +61 -12
- package/html/documentation-index.html +43 -5
- package/html/guides/authentication-default-change.html +43 -5
- package/html/guides/authentication-guide.html +50 -9
- package/html/guides/claude-workflow-guide.html +43 -5
- package/html/guides/documentation-standards.html +43 -5
- package/html/guides/phosphor-icons-guide.html +43 -5
- package/html/guides/private-directory-authentication.html +246 -119
- package/html/guides/public-site-deployment.html +43 -5
- package/html/guides/search-engine-verification-guide.html +43 -5
- package/html/guides/seo-guide.html +43 -5
- package/html/guides/seo-optimization-guide.html +43 -5
- package/html/guides/troubleshooting-guide.html +43 -5
- package/html/guides/windows-setup-guide.html +43 -5
- package/html/index.html +43 -5
- package/html/js/auth.js +118 -39
- package/html/js/main.js +10 -6
- package/html/login.html +3 -3
- package/html/logout.html +2 -2
- package/html/private/cache-control-anti-pattern.html +67 -5
- package/html/private/launch/README.html +67 -5
- package/html/private/launch/auth-cleanup-summary.html +67 -5
- package/html/private/launch/bubble-plugin-specification.html +67 -5
- package/html/private/launch/go-to-market-strategy.html +67 -5
- package/html/private/launch/launch-announcements.html +67 -5
- package/html/private/launch/vercel-deployment-auth-setup.html +67 -5
- package/html/private/next-steps-walkthrough.html +67 -5
- package/html/private/supabase-auth-implementation-completed.html +67 -5
- package/html/private/supabase-auth-implementation-plan.html +67 -5
- package/html/private/supabase-auth-integration-plan.html +67 -5
- package/html/private/supabase-auth-setup-guide.html +67 -5
- package/html/private/test-private-doc.html +67 -5
- package/html/private/user-management-tooling.html +587 -0
- package/html/robots.txt +4 -0
- package/html/sitemap.xml +49 -43
- package/html/vercel-cli-setup-guide.html +43 -5
- package/html/vercel-first-time-setup-guide.html +43 -5
- package/lib/config.js +20 -27
- package/lib/core-builder.js +9 -1
- package/lib/shared-auth-config.js +21 -0
- package/lib/supabase-auth.js +20 -14
- package/package.json +1 -1
- package/user-management/README.md +280 -51
- package/user-management/add-users.sh +661 -262
- 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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
69
|
-
"dateModified": "2025-07-
|
|
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.
|
|
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
|
|
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
|
|
188
|
-
<h2>
|
|
189
|
-
<h3>
|
|
190
|
-
<p>
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
<li>
|
|
194
|
-
<li>
|
|
195
|
-
<li>
|
|
196
|
-
</
|
|
197
|
-
|
|
198
|
-
<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
|
|
201
|
-
├──
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
<
|
|
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: 'supabase' // 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: 'supabase'</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>
|
|
275
|
+
<h3>Private Directory Mode</h3>
|
|
276
|
+
<p><strong>Unauthenticated users see:</strong></p>
|
|
212
277
|
<ul>
|
|
213
|
-
<li>
|
|
214
|
-
<li>
|
|
215
|
-
<li>
|
|
216
|
-
<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
|
-
<
|
|
283
|
+
<p><strong>Authenticated users see:</strong></p>
|
|
219
284
|
<ul>
|
|
220
|
-
<li>
|
|
221
|
-
<li>
|
|
222
|
-
<li>
|
|
223
|
-
<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
|
-
<
|
|
226
|
-
<p>
|
|
227
|
-
<
|
|
228
|
-
<
|
|
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'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: 'https://your-project.supabase.co',
|
|
232
|
-
supabaseAnonKey: 'your-anon-key',
|
|
233
|
-
siteId: 'your-site-id'
|
|
304
|
+
supabaseUrl: 'https://your-project.supabase.co', // Optional override
|
|
305
|
+
supabaseAnonKey: 'your-anon-key', // Optional override
|
|
306
|
+
siteId: 'your-site-id' // Optional custom ID
|
|
234
307
|
}
|
|
235
308
|
};
|
|
236
309
|
</code></pre>
|
|
237
|
-
<h3>2.
|
|
238
|
-
<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
|
|
249
|
-
<pre><code class="language-sql"
|
|
250
|
-
|
|
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 ('user-uuid-from-auth-users', 'your-site-id');
|
|
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
|
|
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
|
|
259
|
-
├──
|
|
260
|
-
└── team/
|
|
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
|
|
365
|
+
<h3>Security Features</h3>
|
|
263
366
|
<ol>
|
|
264
|
-
<li><strong>
|
|
265
|
-
<li><strong>
|
|
266
|
-
<li><strong>
|
|
267
|
-
<li><strong>
|
|
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
|
|
270
|
-
<p>
|
|
372
|
+
<h3>Migration Strategies</h3>
|
|
373
|
+
<p><strong>Moving to Private Directory Mode:</strong></p>
|
|
271
374
|
<ol>
|
|
272
|
-
<li>
|
|
273
|
-
<li>Move
|
|
274
|
-
<li>Update
|
|
275
|
-
<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
|
-
<
|
|
278
|
-
<
|
|
279
|
-
<
|
|
280
|
-
<
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
380
|
+
<p><strong>Moving to Full Site Mode:</strong></p>
|
|
381
|
+
<ol>
|
|
382
|
+
<li>Add <code>authentication: 'supabase'</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>
|
|
289
|
-
<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: 'supabase' // 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
|
-
├──
|
|
292
|
-
├──
|
|
293
|
-
|
|
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
|
-
├──
|
|
300
|
-
├──
|
|
301
|
-
└──
|
|
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
|
-
<
|
|
306
|
-
<
|
|
307
|
-
<
|
|
308
|
-
<
|
|
309
|
-
<
|
|
310
|
-
<
|
|
311
|
-
</
|
|
312
|
-
<
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
<
|
|
316
|
-
<
|
|
317
|
-
</
|
|
318
|
-
<
|
|
319
|
-
|
|
320
|
-
<
|
|
321
|
-
<
|
|
322
|
-
<
|
|
323
|
-
<
|
|
324
|
-
</
|
|
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: 'supabase'</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
|
|
454
|
+
<p>The @knowcode/doc-builder provides two simple ways to protect your documentation:</p>
|
|
327
455
|
<ol>
|
|
328
|
-
<li>
|
|
329
|
-
<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>
|
|
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 ('user-uuid-here', 'your-site-id');
|
|
|
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-
|
|
69
|
-
"dateModified": "2025-07-
|
|
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.
|
|
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
|
|
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>
|