lunr-module
lunr-module copied to clipboard
bug: public path - how to handle subdomain subdirectories
- when I deploy to gitlab in a subdirectory I'm having issues getting the search json to work
- I'm going to try updating the public path
- didn't work as expected, does a duplicate path call
examples
- https://github.com/lastlink/netlify-cms-nuxt
- https://lastlink.github.io/netlify-cms-nuxt search won't work b/c not root
- https://funktechno.gitlab.io/ works b/c it is root
best I can see is to update the publicpath in the build in nuxt.config.js
build: {
extractCSS: true,
//publicPath: 'PATHPREFIXTOREPLACE/_nuxt',
but this is causing a bunch of path issues for me still w/ a duplicate. e.g. public path 2x for somereason when manually updated.
@lastlink Faced the same issue. How I worked it around:
First add this to nuxt.config.js
router: {
base: process.env.ENV_SUB_PATH || '/'
}
and
build: {
publicPath: (process.env.ENV_SUB_PATH || '/') + '_nuxt'
},
Then define ENV_SUB_PATH as /$CI_PROJECT_NAME/ within your ci/cd variables or pipeline
And then everywhere where its not root (has subdomains) you can do the same movements as here .