Skip to content

Change nginx layout of --open #667

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

Merged
merged 3 commits into from
Mar 6, 2019
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 5, 2019

When you run a build with --open we start a web server locally and
open up a browser window for you to look at them. With the docker-based
build_docs that server is nginx. nginx is fancy, and one of the things
that we can do pretty easily is lay out the files that we serve so they
look fairly like the public web site. This change does just that and it
should come in handy to test future work we plan to do that generates an
nginx config to deploy to the site serving the docs.

When you run a build with `--open` we start a web server locally and
open up a browser window for you to look at them. With the docker-based
`build_docs` that server is nginx. nginx is fancy, and one of the things
that we can do pretty easily is lay out the files that we serve so they
look fairly like the public web site. This change does just that and it
should come in handy to test future work we plan to do that generates an
nginx config to deploy to the site serving the docs.
@nik9000 nik9000 requested review from a user and ddillinger March 5, 2019 20:10
build_docs Outdated
@@ -234,7 +234,7 @@ def run_build_docs(args):
# is weird. If we tell it that the browser's name is `open`
# we'll get whatever the user set as their default browser.
environ['BROWSER'] = 'open'
webbrowser.open('http://localhost:8000', new=1, autoraise=False)
webbrowser.open('http://localhost:8000/guide', new=1, autoraise=False)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new path. It mirrors the public site nicely when you do ./build_docs --all --open

@@ -710,7 +710,7 @@ sub serve_and_open_browser {
if ( not $running_in_standard_docker ) {
sleep 1;
say "Press Ctrl-C to exit the web server";
open_browser("http://localhost:8000/$open_path");
open_browser("http://localhost:8000/");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always the path when you build the docs with ./build_docs.pl which doesn't support --all.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stay fancy.

@nik9000 nik9000 merged commit 38f60f3 into elastic:master Mar 6, 2019
@nik9000
Copy link
Member Author

nik9000 commented Mar 6, 2019

Thanks for reviewing @Jarpy!

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

Successfully merging this pull request may close these issues.

1 participant