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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_docs
Original file line number Diff line number Diff line change
Expand Up @@ -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

if should_forward_ssh_auth_into_container:
match = re.match('Waiting for ssh auth to be forwarded to (.+)',
line)
Expand Down
10 changes: 5 additions & 5 deletions build_docs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ sub build_local {

if ( $Opts->{open} ) {
say "Opening: " . $html;
serve_and_open_browser( $dir, 'index.html' );
serve_and_open_browser( $dir );
}
else {
say "See: $html";
Expand Down Expand Up @@ -245,7 +245,7 @@ sub build_all {
check_links($build_dir);
}
push_changes($build_dir, $target_repo, $target_repo_checkout) if $Opts->{push};
serve_and_open_browser( $build_dir, '/' ) if $Opts->{open};
serve_and_open_browser( $build_dir ) if $Opts->{open};

$temp_dir->rmtree;
}
Expand Down Expand Up @@ -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.

}

wait;
Expand Down Expand Up @@ -738,8 +738,8 @@ sub serve_and_open_browser {
access_log /dev/stdout short;
server {
listen 8000;
location / {
root $dir;
location /guide {
alias $dir;
add_header 'Access-Control-Allow-Origin' '*';
if (\$request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
Expand Down