Open kleinlennart opened 1 year ago
Thanks for the report!
Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks.
Thank you for using Quarto and reporting an issue!
Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate. If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository. Without a reproducible example, it is unlikely that the issue will be addressed.
You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````
).
````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
The end.
hugo serve
can be called directly. We may not add all the details in our doc, but using quarto preview
for such project will serve using hugo serve
This implies the hugo
command is in the PATH. Quarto does not search for the command (as it would do for R or Python).
blogdown does install Hugo with an installer but it does not add to PATH by default. This is because blogdown is designed to help maintain several project with different Hugo versions, and configure the version to use in project's .Rprofile
.
With Quarto, you would need to add the hugo
command path you want to use in the PATH variable for the project. Using environment variables feature from Quarto could help do that at project level and not system wise.
I am not sure how we can improve this or what is the best idea. Quarto is not meant to manage Hugo and quarto preview
is just a convenient way to run hugo serve --port {port} --bind {host} --navigateToChanged
for the user.
A workflow could also be to run this command on the output folder, and works in quarto source project to render files and live preview.
We'll keep this open to see if we can find a way to improve for blogdown users.
I ran into the same problem, but under different circumstances.
User case: I have a Hugo site on Cloudflare.
The site is automatically rebuilt when updates are pushed to github.
After reading an article about Quarto (https://quarto.org/docs/output-formats/hugo.html) I decided to try to integrate the content generated using Quarto into my site, and also ensure that the site is updated when updates are pushed to git.
This requires the ability to preview content in hugo format.
To generate content, I use RStudio Server, which is deployed using Docker.
I created an R project in Rstudio using Git (clone my Hugo site git-project).
And in this project, no quarto documents are generated at all. I get the same error as the author.
Does this approach work? Is there a way to use quarto preview in Rstudio Server?
@RKonstantinR do you have hugo install and findable in PATH ?
@RKonstantinR do you have hugo install and findable in PATH ?
I added hugo installation to my dockerfile:
RUN apt-get install hugo
And when I render a quarto-document, it generates plain markdown files (.md), but a blank page opens in the browser.
Is it possible to preview hugo pages using Rstudio-server?
I added hugo installation to my dockerfile: RUN apt-get install hugo
Can you check the hugo version ? hugo version
It is possible that the version available in official repo is quite old. Follow step at https://gohugo.io/installation/linux/ to install hugo.
You need a recent version of Hugo if you follow the quickstart (https://quarto.org/docs/output-formats/hugo.html#creating-a-page) as Page Bundles is from v0.32.
Current version is 0.118.2 so I would advice to use a recent one.
To be clear, it works. hugo serve
is called by Quarto FWIW.
Thanks for your reply!
You were right, the old version of Hugo (v0.92.2) was installed from the official repository.
I edited the dockerfile and installed the latest version of Hugo (v0.118.2):
# download deb file
RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.118.2/hugo_0.118.2_linux-amd64.deb -o hugo.deb
# install
RUN apt-get install ./hugo.deb
When I render a quarto-document, it generates plain markdown files (.md), but the browser shows the page "Page Not Found"
My enviropment:
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
My qmd:
---
title: "Test"
date: "2023-09-19"
format: hugo-md
---
## Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
## Running Code
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
```{r}
1 + 1
The echo: false
option disables the printing of code (only output is displayed).
Quarto check output:
[✓] Checking versions of quarto binary dependencies... Pandoc version 3.1.1: OK Dart Sass version 1.55.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.3.450 Path: /opt/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK Version: 3.10.12 Path: /tmp/Rtmp8opg1O/rstudio/terminal/python3 Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK Version: 4.3.1 Path: /usr/local/lib/R LibPaths:
[✓] Checking Knitr engine render......OK
Quarto preview (in terminal):
Terminating existing preview server....DONE
Preparing to preview
Watching files for changes Watching for changes in /home//{archetypes,assets,content,layouts,static} Watching for config changes in /home//config/_default Start building sites … hugo v0.118.2-da7983ac4b94d97d776d7c2405040de97e95c03d linux/amd64 BuildDate=2023-08-31T11:23:51Z VendorInfo=gohugoio
WARN found no layout file for "html" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for layout "simple" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "html" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN found no layout file for "json" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
| EN
-------------------+-----
Pages | 10
Paginator pages | 0
Non-page files | 14
Static files | 7
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Built in 25 ms Environment: "development" Serving pages from memory Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender http://localhost:4759/ Web Server is available at http://localhost:4759/ (bind address 127.0.0.1)
I think to move forward you need to create a Github repo of what you are trying to do, and share it here. This will be easier than me asking question (like what is your project organization).
This way I can clone the repo and try on my side. I did a quick test following hugo quickstart and adding a .qmd and it all worked fine
Also next time, please do open a new issue. This issue is about blogdown install version of Hugo, and not your rendering issue. So open a new issue, and share a github repo with your problem. Thank you
Bug description
I followed the official guide on using Quarto with an existing blogdown Hugo project.
I use
blogdown::install_hugo()
to update Hugo from time to time (which installs it in~/Library/Application Support/Hugo/
on macOS).When I used
quarto preview
on the project, I got an error:brew install hugo
fixed the issue. However,blogdown
now finds two versions and occasionally recommends uninstalling the brew version (which would lead to the error again)quarto preview
should probably be more verbose about this dependency and offer a better error message (potentially even inquarto check
)Steps to reproduce
The
_quarto.yml
used for the project:With the Quarto files in
content/post/**/index.qmd
. -> It works perfectly fine after brew installing Hugo.Your environment
Quarto check output