quarto-dev / quarto-dev/quarto-cli

Sidebar configuration either errors or is unintuitive

Open
#11,641 5 comments 0 reactions 2 assignees View on GitHub

@cderv is already working on this.

Since Dec 11, 2024.

bug website-navigation websites
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I have the following folder structure for an internal project:

├── home
│   ├── projects
│   │   ├── foo-bar
│   │   └── baz-qux
│   └── faq
│       ├── environment-variables
│       ├── git-bash
│       ├── hidden-files
│       ├── python
│       └── conda
└── developer-guide

And I would like a sidebar where I have manual control of the top level but auto generate the contents of sub levels


On Windows (but not on MacOS; I believe this works on MacOS) the following errors:

  sidebar:
    contents:
      - section: Projects
        contents: home/projects/
ERROR: TypeError: Cannot convert undefined or null to object

Stack trace:
    at Function.keys (<anonymous>)
    at findIndexFile (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:94015:19)
    at nodesToEntries (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:93991:35)
    at sidebarItemsFromAuto (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:93919:31)
    at expandAutoSidebarItems (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:93841:37)
    at expandAutoSidebarItems (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:93860:39)
    at resolveSidebarItems (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:94873:32)
    at sidebarEjsData (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:94864:11)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async sidebarsEjsData (file:///C:/Users/USERNAME/AppData/Local/Programs/Quarto/bin/quarto.js:94848:26)

....

GET: /home/

I expected this to work but doesn't work (renders an empty sidebar):

  sidebar:
    style: docked
    contents:
      - auto: home/software/*

This is the only way I was able to get quarto to read all the files just one level deep:

  sidebar:
    contents:
      - href: home/index.qmd
        text: Home
      - section: Projects
        contents: home/projects/**/*
      - section: FAQ
        contents: home/faq/**/*

I'm using the latest quarto:

quarto --version
1.6.39
Steps to reproduce
  1. quarto create project website
  2. make folder structure as shown with an index.qmd file in each of them
Expected behavior

Quarto should never error. auto doesn't seem to work in a sublevel. If it can't generate a sidebar, it would be nice if it could explain why.

Actual behavior

No response

Your environment

No response

Quarto check output
$ quarto check
Quarto 1.6.39
[>] Checking environment information...
      Quarto cache location: C:\Users\USERNAME\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.6.39
      Path: C:\Users\USERNAME\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.12.5 (Conda)
      Path: C:/Users/USERNAME/miniforge3/python.exe
      Jupyter: 5.7.2
      Kernels: python-localvenv, python3

(/) Checking Jupyter engine render....
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Cannot start python-localvenv kernel:

Expected folder ".venv" in notebook directory C:\Users\USERNAME\AppData\Local\Temp\quarto-session4e81de456f3f6040\bd1a910c856c0074
(or any parent directory)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

(\) Checking Jupyter engine render....2024-12-09 11:12:47,291 - traitlets - ERROR - Error occurred while starting new kernel client for kernel 4ad7a9ad-7a67-47b1-b12a-ef9739c5a38c: Kernel died before replying to kernel_info


Kernel died before replying to kernel_info
[>] Checking Jupyter engine render....OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.