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

Command line flag to open localhost:1313 #13040

Closed
rjc123 opened this issue Nov 14, 2024 · 4 comments · Fixed by #13042
Closed

Command line flag to open localhost:1313 #13040

rjc123 opened this issue Nov 14, 2024 · 4 comments · Fixed by #13042
Assignees
Milestone

Comments

@rjc123
Copy link

rjc123 commented Nov 14, 2024

As a not-very-technical hugo user
I would like to generate my site locally to test (heavily using hugo server -D) and see it immediately upon build in a local browser.
So that I can review it works as I would have expected.

hugo server -D && open http://localhost:1313 doesn't function, as it requires the server command to complete before opening the browser
open http://localhost:1313 && hugo server -D does function as needed, but doesn't match the order one would think about these things.

The best result would be hugo server -D -o -- so that the browser opens to the localhost immediately on the first build of the site, leaving the server running.

@bep bep removed the NeedsTriage label Nov 14, 2024
@bep bep added this to the v0.139.0 milestone Nov 14, 2024
@bep
Copy link
Member

bep commented Nov 14, 2024

I think we have had this discussion before, and I think the argument against it was that it wasn't a good/simple multi platform way to do this. But I see now that this exists, which looks solid enough:

https://github.com/pkg/browser

As to flags, I would suggest we go for -O (uppercase). I have tried to make it lowercase=configuration, uppercase=actions. Some of the uppercase are a little bit borderline, but I think it makes sense.

So:

hugo server -O

@bep bep modified the milestones: v0.139.0, v0.138.0 Nov 14, 2024
@bep bep self-assigned this Nov 14, 2024
bep added a commit to bep/hugo that referenced this issue Nov 14, 2024
@bep bep closed this as completed in ac6962d Nov 14, 2024
@rjc123
Copy link
Author

rjc123 commented Nov 27, 2024

Hey, this is great -- thanks a ton for putting this in place.

@bep bep removed the Proposal label Nov 27, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy