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

Conversation

Projects
None yet
2 participants
@whitequark
Contributor

whitequark commented Aug 20, 2017

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

Print site URL when running `nanoc view`.
Many terminals (e.g. Konsole) let me open an URL by clicking it,
which is quite convenient.
@ddfreyne

Looks great! Thanks :)

@@ -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]}/"

This comment has been minimized.

@ddfreyne

ddfreyne Aug 20, 2017

Member

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. :/

@ddfreyne

ddfreyne Aug 20, 2017

Member

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. :/

This comment has been minimized.

@whitequark

whitequark Aug 20, 2017

Contributor

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.

@whitequark

whitequark Aug 20, 2017

Contributor

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.

@ddfreyne ddfreyne merged commit 970ec96 into nanoc:master Aug 20, 2017

3 checks passed

codecov/patch Coverage not affected when comparing 21dc706...ebdccd2
Details
codecov/project 98.7% remains the same compared to 21dc706
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@whitequark whitequark deleted the whitequark: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