Skip to content
Select theme

Removing what you don't need

Both features are optional, and the template is built to come apart cleanly. Deleting the logged-in tier is also what unlocks fully static hosting — see Deploy.

Delete
public/openapi.yaml, public/openapi-admin.yamlThe two bundled example documents. (The third example is a remote URL — deleting its entry from the config is all it takes.)
src/pages/api/The route.
src/pages/api-spec/The endpoint that serves documents kept outside public/.
src/config/api-reference.mjsThe reference list.
src/lib/openapi-sidebar.mjsThe generated sidebar group.
src/components/ScalarApiReference.astro, src/components/ApiSearchIndex.astroThe Scalar wrapper and its search bridge.
tests/openapi-sidebar.test.mjs, tests/api-reference-config.test.mjs, tests/api-spec-endpoint.test.mjs, tests/api-spec-equivalence.test.mjs, tests/scalar-api-reference.test.mjs, tests/visual/api-reference.spec.mjsTheir tests.

Then, in astro.config.mjs: remove the apiReferenceSidebar block, its imports from src/config/api-reference.mjs and src/lib/openapi-sidebar.mjs, and its spread into the sidebar: array.

Uninstall the Scalar dependencies and the overrides entry pinning one of them to this project’s Astro version:

Terminal window
npm uninstall @scalar/astro @scalar/openapi-parser @scalar/workspace-store
Delete
src/content/private-docs/, src/content/org-docs/The two collections’ content.
src/pages/private/, src/pages/auth/, src/pages/demo-login.astroThe guarded routes and the demo login.
src/middleware.tsThe guard.
src/config/auth.mjs, src/config/demo-login.mjsAuth and demo-login configuration.
src/lib/auth/, src/lib/demo-login.mjs, src/lib/private-sidebar.mjs, src/lib/sidebar-items.mjsSupporting logic.
src/components/AuthControl.astroThe Log in / Log out control.
tests/auth-*.test.mjs, tests/demo-login.test.mjs, tests/private-leaks.test.mjs, tests/sidebar-items.test.mjs, tests/visual/auth.spec.mjs, tests/visual/demo-login.spec.mjs, tests/mock-sso/Their tests, and the mock SSO server.

Then:

  1. Drop the privateDocs and orgDocs collections from src/content.config.ts.
  2. Drop privateDocsLink from src/config/sidebar.mjs, and its conditional use in astro.config.mjs.
  3. Remove the AuthControl import and its render from src/components/CustomHeader.astro and src/components/CustomMobileMenuFooter.astro. If that leaves the latter doing nothing else, delete it and its MobileMenuFooter override in astro.config.mjs too.
  4. Remove the hint-cookie import and inline script from src/components/CustomHead.astro.
  5. Remove the dev:sso script from package.json and the mock-SSO webServer entry from playwright.config.mjs.

Then get the plain static build back, or the site keeps shipping a server it no longer needs:

  1. In astro.config.mjs, change the adapter: line to adapter: process.env.VERCEL ? vercel() : undefined, and remove the env: block, the @astrojs/node import, the ssoConfigured line and its use in the sidebar array, the three DOCS_SSO_* names from the loadEnv destructure, and the sitemap filter.

  2. Uninstall the Node adapter and the token library — and keep @astrojs/vercel if you deploy to Vercel. It is how Vercel’s features, Markdown negotiation among them, reach a static site; this site is built that way. Deploying anywhere else, uninstall it too and drop the vercelMarkdownNegotiation() line from astro.config.mjs.

    Terminal window
    npm uninstall @astrojs/node jose

Skipping that second half leaves dist/server/ in the build output with no dist/index.html at the root — which quietly breaks static-host deploy instructions that expect one.

None of these break the build, but each is now dead weight or actively misleading:

FileWhat to do
src/env.d.tsDrop the App.Locals.session type — it existed only for the middleware.
.env.example, .env.testAlmost entirely DOCS_SSO_* and DOCS_UNSAFE_DEMO_LOGIN. Strip to what you still use, or delete.
src/content.config.tsThe glob import is unused once the two collections go.
src/config/sidebar.mjsIts module docstring describes a private sidebar that no longer exists.
astro.config.mjsThe long comments above the lines you removed explain a sitemap filter and an adapter split that are gone.

npm run test:visual and playwright.config.mjs have nothing left to test once both features are gone — their only two subjects are the API reference and the SSO round trip. Delete playwright.config.mjs, tests/visual/, tests/helpers/test-servers.mjs, the three test:visual* scripts, and the @playwright/test dependency.

These steps were executed end to end when EkLine built this documentation site from the template, and corrected from what that run actually hit.

Maintained by EkLine