Skip to content

Commit fe0cbb3

Browse files
committed
fix(docs): make API docs browseable on GitHub Pages
Two problems prevented /viktorani/api/ from being browseable: 1. Service worker navigation fallback intercepted all requests under /viktorani/ and served index.html instead of the TypeDoc files. Fix: add navigateFallbackDenylist: [/^\/viktorani\/api\//] to the Workbox config in vite.config.ts so the SW passes those requests through to the static files on gh-pages. 2. typedoc-plugin-markdown produced .md files that browsers cannot render natively. Fix: remove the plugin so TypeDoc generates its default HTML output — self-contained with sidebar nav and search. Also removes typedoc-plugin-markdown from devDependencies in package.json.
1 parent d11ee30 commit fe0cbb3

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"release-it": "^19.2.4",
6262
"tailwindcss": "^4.2.2",
6363
"typedoc": "^0.28.0",
64-
"typedoc-plugin-markdown": "^4.6.0",
6564
"typescript": "~5.9.3",
6665
"typescript-eslint": "^8.57.0",
6766
"vite": "^8.0.1",

typedoc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
"name": "Viktorani API",
1616
"readme": "none",
1717
"includeVersion": true,
18-
"disableSources": false,
19-
"suppressCommentWarningsInDeclarationFiles": true,
20-
"plugin": ["typedoc-plugin-markdown"]
18+
"disableSources": false
2119
}

vite.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export default defineConfig({
2828
},
2929
workbox: {
3030
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
31+
// Prevent the service worker from intercepting requests to the
32+
// TypeDoc API docs deployed at /viktorani/api/
33+
navigateFallbackDenylist: [/^\/viktorani\/api\//],
3134
},
3235
}),
3336
],
@@ -44,8 +47,6 @@ export default defineConfig({
4447
exclude: [
4548
'node_modules/',
4649
'dist/',
47-
'archive/',
48-
'deploy/',
4950
'src/main.tsx',
5051
'src/pages/**', // page-level integration — tested via e2e
5152
'src/components/AdminLayout.tsx',

0 commit comments

Comments
 (0)