I am experimenting with quarto
to see how I can create a website. These are the steps that I have followed so far:
- Open RStudio (RStudio Server 2022.02.0 Build 443)
- Go to File > New Project... > New Directory > Quarto Website > type Directory name: > Create Project
- Go to Build > Render Website
This works fine! However, when I try to add a section for blog, the website doesn't compile correctly. Here's what I did:
- Create a blog folder under root
- Create a file blog/index.qmd
- Create a blog/posts folder
- Create a blog/posts/test-post folder
- Add files index.qmd and featured.jpg to blog/posts/test-post folder
Run this code in R console to add featured.jpg file:
download.file(
"https://upload.wikimedia.org/wikipedia/commons/3/3f/August_Macke_-_Three_girls_in_yellow_straw_hats_I_-_Google_Art_Project.jpg",
"blog/posts/test-post/featured.jpg"
)
Here are the contents of the blog/index.qmd file:
---
title: This is my blog.
listing:
contents: posts
type: default
---
Here are the contents of the blog/posts/test-post/index.qmd file:
---
title: My first blog post.
image: featured.jpg
---
Here are the contents of the _quarto.yml
file:
project:
type: website
website:
title: "test-quarto-web"
navbar:
background: primary
left:
- href: index.qmd
text: Home
- about.qmd
- href: blog/index.qmd
text: Blog
format:
html:
theme: cosmo
css: styles.css
editor: visual
After I render the website and click on the Blog menu, this is what I see:
How can I fix this issue? I believe there is some problem with the file path, but I couldn't figure out how to fix this!