Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use with NextJS Export #46

Open
rosalinekarr opened this issue Feb 26, 2021 · 1 comment
Open

Cannot use with NextJS Export #46

rosalinekarr opened this issue Feb 26, 2021 · 1 comment

Comments

@rosalinekarr
Copy link

rosalinekarr commented Feb 26, 2021

Sidebars fail to properly generate when running next export. Export doesn't run a server, so the sidebar.json is never generated and the sidebar is not rendered in the static output. This means dokz can't be used with a static hosting service like Github Pages.

@ben-rho-des
Copy link

ben-rho-des commented Sep 12, 2021

I was able to get dokz to work in gh pages this way.

modify next.config.js

const isProd = process.env.NODE_ENV === 'production';

module.exports = {
assetPrefix: isProd ? '/<your-gh-pages-project-name>/' : '',
}

This should correct the navigation once deployed.

And to deploy add this script

"deploy": "rm -rf node_modules/.cache && next build && next export && touch out/.nojekyll && git add out/ && git commit -m \"Deploy Next.js to gh-pages\" && git subtree push --prefix out origin gh-pages"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants