-
Notifications
You must be signed in to change notification settings - Fork 334
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 progress messages when serving site? #555
Comments
One way to achieve this is |
On windows, if I set It would be indeed interested if we could do the trick in hugodown, same one described in r-lib/processx#72 (comment) when advice to use the later package poll_process <- function() {
if (!ps$is_alive()) {
return()
}
out <- ps$read_output()
if (!identical(out, "")) {
cat(out)
}
later::later(delay = 1, poll_process)
}
poll_process() This is what allow hugodown to output the background process messages into the R console. |
@cderv Thanks! I know how to implement it. I was only saying that it was not straightforward---you have to keep polling. I was wishing for the succinct syntax @apreshill I said almost exactly the same thing at r-lib/processx#72 (comment):
Anyway,
When any Hugo errors occur, you will see the errors in the page preview like this: #546 (comment) If you don't see errors in the viewer/browser, you can be pretty much sure that no errors occurred.
The message "Change detected, rebuilding site" doesn't indicate if the preview has been updated. It only says the site was rebuilt. If you feel the preview is not updated, chances are it really is not, and something else might be wrong (like #556). |
@apreshill Now you can use @cderv I'm currently using |
Ok great. Eventually, using several methods ends up being more complicated than staying with one (only processx or xfun). This will be enough I think for a debug mode with verbosity. Thank you! |
Hi @yihui,
I've been working a lot with blogdown over the past week, and realized one thing that led me to some errors introduced by over-page-refreshing. When I make changes to my site with
serve_site()
running, the only thing that prints to the console (over and over again) isblogdown:::preview_site()
. But if I'm running hugo server in the terminal I see:These last two "changes detected" are helpful as it cues me to know there aren't any errors, and when to know if the preview has been updated (it is sometimes hard to see in the browser when live reload refreshes). I was hitting page refresh often and thanks to @cderv realized this was leading me to experience more issues. Do you think something like this could print to the console as you work?
The text was updated successfully, but these errors were encountered: