-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat(serve): --base-path serves docs from a subpath to match GitHub pages #47
base: master
Are you sure you want to change the base?
Conversation
Seems like the red build has the same cause as the red builds on master:
|
Great PR.. Is there another way around this for local development? EDIT: For anyone else reading, my workaround was to dynamically set base path depending on
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, just needs conflicts resolved.
A workaround is to use another static serve like apache or nginx, and configure the root path in one of those. |
Unfortunately, it seems like the popular NPM packages for static serving don't support this feature. Unless I overlooked it, |
@trusktr It's supported via middleware. It should be possible to rewrite all requests matching the configured path. e.g.
And so on. |
Seems like what we should do is instead of building our own static server CLI with defaults, allow any options to be passed to the underlying tool, support passing in middleware, and maybe have our own default set of middleware if we need. Thoughts? EDIT: even if we were to do this later, I'm still in favor of merging this PR. |
I fixed that for the moment using Running command: Maybe when I'll get some time will fix the CI and complete the PR |
Before this PR
Using a
base-path
in$docsify
config makesdoscify serve .
unusable for local development - all requests just return 404.After this PR
I'll be able to run
docsify serve . --base-path 'my-project'
to replicate the behaviour of GitHub pages (which always uses a sub path, e.g.https://iamdanfox.github.io/my-project
).fixes #32 cc @davestewart who originally filed the issue