-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
open browser when run on mac #5595
Comments
https://github.com/gohugoio/hugo/blob/master/commands/server.go#L443 Should I submit a PR? |
No, I don't think that is a good idea, but I'll leave this issue open if others want to chime in. |
the idea was to address something that always annoyed me (minor irritation). I only see positives and no negatives.
What about a new flag that opens the browser up? |
I quite like this idea, but it should be an opt-in feature, and not happen by default. Assuming it's smart enough to just open a new tab in an existing browser rather than forcefully spawning a new one. Side note: Is there a reason this can't be done on the other supported platforms too? |
I agree with the orange colored one. If this was done at all, should be opt-in. I don't like the idea of a new tab opening automatically. I would assume then a |
Give me a flag name and I'll make a PR |
Well I use GitHub's So I vote for a
|
it's 1 extra letter plus a bit more self-explanatory in what it does. |
Sounds good to me. |
As I said, I'm currently not merging such a feature. I'm not convinced that this is worth it; note that adding code to Hugo isn't just about ... adding it; I assume you need a dependency or two which adds work later in the build chain, and the code/tests needs to be maintained by someone. |
@bep please close the issue. don't waste anyone's time keeping it open under the pretence that it is in theory possible to flip your opinion on the matter. Having said that, thank you for your amazing product. It's the best static site generator out there in my honest opinion. |
Gatsby and plenty of other generators do this. Its so simple that I have no idea why you wouldn't add it. |
Hi. Thats probably not going to change your opinion @bep but personally I would find this feature useful too. I come from a JavaScript / Node.js space, and majority of the server tools implement this feature under the optional Thanks for building an amazing product! |
There are a lot of tools that run a HTTP server in command line, some can open the browser automatically, some just print the url in stdout, which can be easily opened by clicking in modern terminals. But hugo supports neither, which I think is the real problem here. Currently hugo just prints:
..that is not a valid url to click. Whether to open browser is a strategy division, but helping user to easily access the site server is a must-have feature for a CLI tool. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Here is an idea:
If the
GOOS
iswindows
ordarwin
, when you runhugo server
, it should open up the browser page immediately:http://localhost:1313/
using package:github.com/pkg/browser
.It should not do so after a live reload obviously.
The text was updated successfully, but these errors were encountered: