Skip to content

Disable Pre-render #51

@brunoalano

Description

@brunoalano

Describe the bug

There is some way to disable the pre-render when using this plugin? I am using an authentication middleware on my documentation, and would like to block some requests.

To Reproduce

Using an authentication middleware won't work because of the following snippet:

export function starlightOpenAPIIntegration(schemas: Schema[]): AstroIntegration {
  const starlightOpenAPI: AstroIntegration = {
    name: 'starlight-openapi',
    hooks: {
      'astro:config:setup': ({ injectRoute, updateConfig }) => {
        injectRoute({
          entrypoint: 'starlight-openapi/route',
          pattern: `[...openAPISlug]`,
          prerender: true,
        })

        updateConfig({
          vite: {
            plugins: [vitePluginStarlightOpenAPISchemas(schemas)],
          },
        })
      },
    },
  }

  return starlightOpenAPI
}

Expected behavior

An option to disable the pre-render

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions