Skip to content

Commit 0972b47

Browse files
committed
fix(docs): keep the GitHub introduction to Git video route public
Video routes 8-10 keep the demo external-auth guard; route 11 has no authorization so the Video menu section and its player are visible to every visitor.
1 parent ff1343b commit 0972b47

6 files changed

Lines changed: 33 additions & 43 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ https://vidigal-code.github.io/git-page-docs
460460
https://vidigal-code.github.io/git-page-docs/source-viewer/Vidigal-code/git-page-docs/tree/main/frontend/src
461461
- The standalone viewer shows a back button beside the GitHub link (langmenu key `sourceViewerBackLabel`) that returns to the site root keeping the current look, e.g. `/?theme=skyline-dark&modetheme=dark`.
462462

463-
**Video pages** (sign-in required; see [Video routes](#video-routes) for the embedded test video)
463+
**Video pages** (`id=8` to `id=10` require sign-in; `id=11` is open to every visitor, see [Video routes](#video-routes))
464464

465465
- Interactive vs non-interactive modes (`id=8`):
466466
https://vidigal-code.github.io/git-page-docs/Vidigal-code/git-page-docs/v/0.0.7/?lang=en&menu=en&id=8
@@ -514,18 +514,19 @@ Video pages come from `routes-video` in the version config. Each route sets `vid
514514
video id. The viewer renders the route inside the docs shell, and `?videofull=<lang>&id=<route id>`
515515
(or `&slug=<video id>`) opens it fullscreen.
516516

517-
The four video routes of this repository (`id=8` to `id=11`) are GitHub channel videos and carry the
518-
demo `authorization` (`requireExternalAuth`), so they unlock only after signing in with a configured
519-
provider. The same test video is also embedded in the open *Introduction to Git* page (`id=5`), which
520-
any visitor can watch. Markdown pages embed a video as a linked YouTube thumbnail, which renders both
521-
on GitHub and in the viewer.
517+
The video routes of this repository are GitHub channel videos. Routes `id=8` to `id=10` carry the
518+
demo `authorization` (`requireExternalAuth`) and stay hidden from the sidebar until the visitor signs
519+
in with a configured provider. Route `id=11` has no `authorization`, so the **Video** menu section and
520+
its player are always visible. The same test video is also embedded in the *Introduction to Git* page
521+
(`id=5`); markdown pages embed a video as a linked YouTube thumbnail, which renders both on GitHub and
522+
in the viewer.
522523

523524
Test video (GitHub channel, *A brief introduction to Git for beginners*):
524525

525526
[![A brief introduction to Git for beginners | GitHub](https://img.youtube.com/vi/r8jQ9hVA2qs/hqdefault.jpg)](https://www.youtube.com/watch?v=r8jQ9hVA2qs)
526527

527528
- Watch on YouTube: https://www.youtube.com/watch?v=r8jQ9hVA2qs
528-
- Video route (sign-in required): https://vidigal-code.github.io/git-page-docs/Vidigal-code/git-page-docs/v/0.0.7/?lang=en&menu=en&id=11
529+
- Video route: https://vidigal-code.github.io/git-page-docs/Vidigal-code/git-page-docs/v/0.0.7/?lang=en&menu=en&id=11
529530
- Open markdown page: https://vidigal-code.github.io/git-page-docs/Vidigal-code/git-page-docs/v/0.0.7/?lang=en&menu=en&id=5#video
530531
- Fullscreen: https://vidigal-code.github.io/git-page-docs/Vidigal-code/git-page-docs/v/0.0.7/?videofull=en&slug=r8jQ9hVA2qs
531532

@@ -541,10 +542,6 @@ Route definition in `gitpagedocs/docs/versions/0.0.7/config.json`:
541542
"video": {
542543
"videoType": { "en": "youtube", "pt": "youtube", "es": "youtube" },
543544
"pathVideo": { "en": "r8jQ9hVA2qs", "pt": "r8jQ9hVA2qs", "es": "r8jQ9hVA2qs" }
544-
},
545-
"authorization": {
546-
"requireExternalAuth": true,
547-
"allowedProviders": ["authjs", "clerk", "firebase", "jwt"]
548545
}
549546
}
550547
],

‎cli/builders/version-config-builder.mjs‎

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const VIDEO_ROUTE_AUTHORIZATION = {
3535
requireExternalAuth: true,
3636
allowedProviders: EXTERNAL_AUTH_PROVIDERS,
3737
};
38+
/** Video route left open so the scaffold always shows a playable video (GitHub's introduction to Git). */
39+
const PUBLIC_VIDEO_ROUTE_ID = 11;
40+
/** Video routes follow the six markdown pages and the source viewer (ids 8-11). */
41+
const VIDEO_ROUTE_ID_OFFSET = 7;
3842

3943
const ROUTE_METAS = {
4044
1: ROUTE_META_ID1,
@@ -77,17 +81,19 @@ function buildVersionMdRoutes(versionId, includeDemoAuthorization) {
7781
}
7882

7983
function buildVersionVideoRoutes(versionId, includeDemoAuthorization) {
80-
return [1, 2, 3, 4].map((id) =>
81-
buildVideoRoute(
84+
return [1, 2, 3, 4].map((id) => {
85+
const routeId = id + VIDEO_ROUTE_ID_OFFSET;
86+
const isGuarded = includeDemoAuthorization && routeId !== PUBLIC_VIDEO_ROUTE_ID;
87+
return buildVideoRoute(
8288
versionId,
83-
id + 7,
89+
routeId,
8490
"youtube",
8591
VIDEO_IDS[id - 1],
8692
VIDEO_METAS[id].title,
8793
VIDEO_METAS[id].description,
88-
includeDemoAuthorization ? { authorization: VIDEO_ROUTE_AUTHORIZATION } : {},
89-
)
90-
);
94+
isGuarded ? { authorization: VIDEO_ROUTE_AUTHORIZATION } : {},
95+
);
96+
});
9197
}
9298

9399
function buildVersionAudioRoutes(versionId) {
@@ -122,12 +128,15 @@ function buildVersionMenus(versionId) {
122128
en: { title: ROUTE_METAS[id].titles.en, "path-click": `${base}/en/${ROUTE_PATHS[id].en}` },
123129
es: { title: ROUTE_METAS[id].titles.es, "path-click": `${base}/es/${ROUTE_PATHS[id].es}` },
124130
}));
125-
const menuVideo = [1, 2, 3, 4].map((id) => ({
126-
id: id + 7,
127-
pt: { title: `${VIDEO_METAS[id].title.pt.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
128-
en: { title: `${VIDEO_METAS[id].title.en.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
129-
es: { title: `${VIDEO_METAS[id].title.es.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
130-
}));
131+
const menuVideo = [1, 2, 3, 4].map((id) => {
132+
const routeId = id + VIDEO_ROUTE_ID_OFFSET;
133+
return {
134+
id: routeId,
135+
pt: { title: `${VIDEO_METAS[id].title.pt.slice(0, 40)}...`, "path-click": `page:${routeId}` },
136+
en: { title: `${VIDEO_METAS[id].title.en.slice(0, 40)}...`, "path-click": `page:${routeId}` },
137+
es: { title: `${VIDEO_METAS[id].title.es.slice(0, 40)}...`, "path-click": `page:${routeId}` },
138+
};
139+
});
131140
const menuAudio = [
132141
{
133142
id: AUDIO_META_ID12.id,

‎cli/tests/core/builders.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ describe("buildVersionConfig", () => {
294294
pathVideo: { pt: VIDEO_IDS[0], en: VIDEO_IDS[0], es: VIDEO_IDS[0] },
295295
});
296296
expect(video[0].authorization).toEqual({ requireExternalAuth: true, allowedProviders: EXTERNAL_PROVIDERS });
297+
expect(video.filter((route) => route.authorization).map((route) => route.id)).toEqual([8, 9, 10]);
298+
expect(video[3].authorization).toBeUndefined();
297299

298300
const [audio] = config["routes-audio"];
299301
expect(audio.id).toBe(AUDIO_META_ID12.id);

‎gitpagedocs/docs/versions/0.0.7/config.json‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,6 @@
373373
"en": "r8jQ9hVA2qs",
374374
"es": "r8jQ9hVA2qs"
375375
}
376-
},
377-
"authorization": {
378-
"requireExternalAuth": true,
379-
"allowedProviders": [
380-
"authjs",
381-
"clerk",
382-
"firebase",
383-
"jwt"
384-
]
385376
}
386377
}
387378
],

‎tools/gitpagedocs/docs/versions/0.0.7/config.json‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,6 @@
373373
"en": "r8jQ9hVA2qs",
374374
"es": "r8jQ9hVA2qs"
375375
}
376-
},
377-
"authorization": {
378-
"requireExternalAuth": true,
379-
"allowedProviders": [
380-
"authjs",
381-
"clerk",
382-
"firebase",
383-
"jwt"
384-
]
385376
}
386377
}
387378
],

‎tools/smoke/baseline.snapshot.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"generatedAt": "2026-09-28T17:42:54.401Z",
2+
"generatedAt": "2026-09-28T20:57:42.003Z",
33
"targets": [
44
"gitpagedocs/config.json",
55
"gitpagedocs/langs/en.json",
@@ -12,6 +12,6 @@
1212
"gitpagedocs/langs/en.json": "5efaddcd0429f5f2e632850a13d923d2da2a8720292bb00d642f81357772eee1",
1313
"gitpagedocs/langs/pt.json": "f29cfa74721179058914edffc078beb9a5bd30a6f811aa9ef11ff9eb89212f85",
1414
"gitpagedocs/langs/es.json": "bfd6093ba9112be0568817b40ef2d1bc73f0c96f3c8cdb3461af421df946a0cd",
15-
"gitpagedocs/docs/versions/0.0.7/config.json": "7a8032f61b152d870088debb5c5724d30ad384727d4198c0e8d6b5cec63654b8"
15+
"gitpagedocs/docs/versions/0.0.7/config.json": "3b2f776c2f496cc73b033dbde359c4bed06fec530b7f1baadb020bf18a4f8abb"
1616
}
1717
}

0 commit comments

Comments
 (0)