quarto-dev / quarto-dev/quarto-cli
Single file in `contents:` does not render
Open
@cscheid is already working on this.
Since Jun 5, 2024.
bug
websites
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I don't think this is the most important "bug" to fix; but I figured I would flag. When using a single file in the contents of a section (see example below), that file does not render.
It can be fixed by using a item with - file: about.qmd, but took me about ~30 mins to debug. The reason I bring up the bug at all is that yaml::write_yaml will render a single list item in contents in the form that causes bugs (see example below). This bug impacts the altdoc package (cc @etiennebacher)
Reprex:
- Run
quarto create project website reprexto create simple website. - Change
_quarto.ymlto:
project:
type: website
website:
title: "reprex"
sidebar:
collapse-level: 1
style: docked
contents:
- text: Home
file: index.qmd
- section: Section Header
contents: about.qmd
format:
html:
theme: cosmo
css: styles.css
toc: true
Problems with write_yaml
library(yaml)
txt = c(
"website:",
" title: 'reprex'",
" sidebar:",
" collapse-level: 1",
" style: docked",
" contents:",
" - text: Home",
" file: index.qmd",
" - section: Section Header",
" contents: ",
" - about.qmd"
)
yaml = yaml::yaml.load(txt)
file = tempfile()
write_yaml(yaml, file)
cat(readLines(file), sep = "\n")
#> website:
#> title: reprex
#> sidebar:
#> collapse-level: 1
#> style: docked
#> contents:
#> - text: Home
#> file: index.qmd
#> - section: Section Header
#> contents: about.qmd
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.