@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.
- package/.claude/settings.local.json +4 -1
- package/CHANGELOG.md +7 -0
- package/assets/js/main.js +10 -6
- package/html/README.html +43 -5
- package/html/auth.js +62 -13
- package/html/documentation-index.html +43 -5
- package/html/guides/authentication-default-change.html +43 -5
- package/html/guides/authentication-guide.html +43 -5
- 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 +237 -117
- 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 +4 -4
- package/html/logout.html +2 -2
- package/html/private/cache-control-anti-pattern.html +66 -5
- package/html/private/launch/README.html +66 -5
- package/html/private/launch/auth-cleanup-summary.html +66 -5
- package/html/private/launch/bubble-plugin-specification.html +66 -5
- package/html/private/launch/go-to-market-strategy.html +66 -5
- package/html/private/launch/launch-announcements.html +66 -5
- package/html/private/launch/vercel-deployment-auth-setup.html +66 -5
- package/html/private/next-steps-walkthrough.html +66 -5
- package/html/private/supabase-auth-implementation-completed.html +66 -5
- package/html/private/supabase-auth-implementation-plan.html +66 -5
- package/html/private/supabase-auth-integration-plan.html +66 -5
- package/html/private/supabase-auth-setup-guide.html +66 -5
- package/html/private/test-private-doc.html +66 -5
- package/html/robots.txt +4 -0
- package/html/sitemap.xml +43 -43
- package/html/vercel-cli-setup-guide.html +43 -5
- package/html/vercel-first-time-setup-guide.html +43 -5
- package/lib/config.js +15 -21
- package/lib/core-builder.js +9 -1
- package/lib/supabase-auth.js +20 -14
- package/package.json +1 -1
- package/user-management/README.md +276 -51
- package/user-management/add-users.sh +635 -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: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,
|
|
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
|
|
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
|
|
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 <code>authentication: 'supabase'</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>
|
|
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>
|
|
214
|
-
<li>
|
|
215
|
-
<li>
|
|
216
|
-
<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>
|
|
289
|
+
<h3>Full Site Mode</h3>
|
|
290
|
+
<p><strong>Everyone must:</strong></p>
|
|
219
291
|
<ul>
|
|
220
|
-
<li>
|
|
221
|
-
<li>
|
|
222
|
-
<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>
|
|
227
|
-
<h3>1. Configure
|
|
228
|
-
<p>
|
|
296
|
+
<h2>Setting Up Supabase Authentication</h2>
|
|
297
|
+
<p>Both authentication modes use Supabase for secure user management. Here'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: 'https://your-project.supabase.co',
|
|
232
303
|
supabaseAnonKey: 'your-anon-key',
|
|
233
|
-
siteId: 'your-site-id'
|
|
304
|
+
siteId: 'your-site-id' // Unique identifier for this doc site
|
|
234
305
|
}
|
|
235
306
|
};
|
|
236
307
|
</code></pre>
|
|
237
|
-
<h3>2.
|
|
238
|
-
<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
|
|
249
|
-
<pre><code class="language-sql"
|
|
250
|
-
|
|
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 ('user-uuid-from-auth-users', 'your-site-id');
|
|
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
|
|
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
|
|
259
|
-
├──
|
|
260
|
-
└── team/
|
|
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
|
|
358
|
+
<h3>Security Features</h3>
|
|
263
359
|
<ol>
|
|
264
|
-
<li><strong>
|
|
265
|
-
<li><strong>
|
|
266
|
-
<li><strong>
|
|
267
|
-
<li><strong>
|
|
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
|
|
270
|
-
<p>
|
|
365
|
+
<h3>Migration Strategies</h3>
|
|
366
|
+
<p><strong>Moving to Private Directory Mode:</strong></p>
|
|
271
367
|
<ol>
|
|
272
|
-
<li>
|
|
273
|
-
<li>Move
|
|
274
|
-
<li>Update
|
|
275
|
-
<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
|
-
<
|
|
278
|
-
<
|
|
279
|
-
<
|
|
280
|
-
<
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
373
|
+
<p><strong>Moving to Full Site Mode:</strong></p>
|
|
374
|
+
<ol>
|
|
375
|
+
<li>Add <code>authentication: 'supabase'</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>
|
|
289
|
-
<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: 'supabase' // 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
|
-
├──
|
|
292
|
-
├──
|
|
293
|
-
|
|
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
|
-
├──
|
|
300
|
-
├──
|
|
301
|
-
└──
|
|
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
|
-
<
|
|
306
|
-
<
|
|
307
|
-
<
|
|
308
|
-
<
|
|
309
|
-
<
|
|
310
|
-
<
|
|
311
|
-
</
|
|
312
|
-
<
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
<
|
|
316
|
-
<
|
|
317
|
-
</
|
|
318
|
-
<
|
|
319
|
-
|
|
320
|
-
<
|
|
321
|
-
<
|
|
322
|
-
<
|
|
323
|
-
<
|
|
324
|
-
</
|
|
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: 'supabase'</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
|
|
447
|
+
<p>The @knowcode/doc-builder provides two simple ways to protect your documentation:</p>
|
|
327
448
|
<ol>
|
|
328
|
-
<li>
|
|
329
|
-
<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>
|
|
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 ('user-uuid-here', 'your-site-id');
|
|
|
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-
|
|
69
|
-
"dateModified": "2025-07-
|
|
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,
|
|
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
|
|
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>
|