Skip to content

Support arbitrary base path #18

Description

@remihuigen

docus plus should accept a basePath config option. This will make it easier to integrate docus-plus into an existing app.

Any page routes will be prefixed with that, meaning:

  • /api-reference
  • /changelog
  • /doc-articles
  • /api-resources
  • (if landing is present)

The api and doc articles collections can add this prefix in the content.config.ts

This also mean that the landingspage should be optional. Only if index.yml exists in the content dir, should the landingspage be registrerd. Check the docus implementation pattern for that: https://github.com/nuxt-content/docus/blob/main/layer/modules/routing.ts (they handle this well!)

the basepath can be anything really as long as its url safe. So for example

  • /docs
  • /nested/docs

The base path should have NO EFFECT on api routes or wll-known routes

It SHOULD have an effect on markdown routes, meaning

  • /raw/doc-articles.md
  • /raw/api-resources.md

But i think that will work automatically!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions