Content: Serve @nuxt/content from a subdirectory

Created on 13 Nov 2020  路  2Comments  路  Source: nuxt/content

Hi people,

I cloned the repository for the theme and nuxt/content assumes your project is served from the root of your domain.

Is there a way to change this option to /docs if my project will be hosted in a subdirectory called docs.

I need my docs to be a static site, so I build them using the npm run generate command, but instead to browse the documentation on http://example.com I want to browse it on http://example.com/docs.

question

All 2 comments

@kr-apps

Nuxt Content is a Nuxt module, and it doesn't decide where Nuxt app is mounted, as far as I know.

You can change the base URL via router.base option in nuxt.config.js.

{
  router: {
    base: '/docs'
  }
}

Actually, router option is an alias to options of Vue Router as described in the Nuxt Doc.


I recommend you to refer to this issue as well, just in case.

@NozomuIkuta

Thank's, now it works.

I didn't now we can use and override the router property inside the theme function, I thought we can change just the properties that came with the theme's package and were explained in the docs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pxwee5 picture pxwee5  路  4Comments

dolbex picture dolbex  路  3Comments

emp1tsu picture emp1tsu  路  3Comments

mathieunicolas picture mathieunicolas  路  4Comments

haykokalipsis picture haykokalipsis  路  4Comments