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

Print site URL when running nanoc view #1204

Merged
merged 1 commit into from Aug 20, 2017
Merged

Print site URL when running nanoc view #1204

merged 1 commit into from Aug 20, 2017

Conversation

@whitequark
Copy link
Member

@whitequark whitequark commented Aug 20, 2017

Many terminals (e.g. Konsole) let me open an URL by clicking it, which is quite convenient.

Many terminals (e.g. Konsole) let me open an URL by clicking it,
which is quite convenient.
Copy link
Member

@ddfreyne ddfreyne left a comment

Looks great! Thanks :)

Loading

@@ -52,6 +52,10 @@ def run
run Rack::File.new(site.config[:output_dir])
end.to_app

# Print a link
url = "http://#{options[:host] || 'localhost'}:#{options_for_rack[:Port]}/"
Copy link
Member

@ddfreyne ddfreyne Aug 20, 2017

Choose a reason for hiding this comment

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

You could use options_for_rack[:host] instead of options[:host] || 'localhost'.

This made me wonder whether defaulting to 0.0.0.0, rather than 127.0.0.1, is a sensible default—it probably isn’t. :/

Loading

Copy link
Member Author

@whitequark whitequark Aug 20, 2017

Choose a reason for hiding this comment

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

Oh huh I had no idea http://0.0.0.0:3000/ would actually work in a browser, turns out it does. Feel free to change to your preferred form.

Loading

@ddfreyne ddfreyne merged commit 970ec96 into nanoc:master Aug 20, 2017
3 checks passed
Loading
@whitequark whitequark deleted the show-site-url-in-nanoc-view branch Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants