A page with no headings gets `fullcontent`, so the floating sidebar moves between pages
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by tracing how q2 decides whether to add fullcontent and render #quarto-margin-sidebar when the TOC is enabled but a page has no headings; compare that path with the toc: false case and the behavior described for Quarto 1. The repro provides a three-page website and expected body classes and sidebar counts. Reproduce with q2 render; done means page B keeps the floating layout and margin sidebar, while page C with toc: false still gets fullcontent.
索引モデルが issue の本文から書いたものです。
説明
This issue was drafted with Claude. The output shown comes from running each repro.
Bug description
When the TOC is on but a page has no headings, q2 leaves out the right margin sidebar
(#quarto-margin-sidebar) and adds fullcontent to <body>. The theme gives
body.floating.fullcontent a different grid from body.floating: it has no TOC columns and it
has fixed gutters. So on a site with a floating sidebar, the sidebar and the body column move
when you go from a page with headings to a page without headings. In our site, at a 1708px
window the sidebar moves 125px to the right. Between 992px and about 1200px the sidebar is also
wider (250px instead of 191px).
Quarto 1 does not do this. It keeps the empty margin sidebar on a page with no headings and does
not add fullcontent, so the layout stays the same from page to page. Quarto 1 adds
fullcontent only when the page sets toc: false, and q2 does the same in that case.
This could be the same logic as #1371: q2 adds fullcontent when it thinks nothing uses the
right margin. Here the trigger is an empty TOC, not .column-margin content.
Steps to reproduce
mkdir sidebar-shift && cd sidebar-shift
printf 'project:\n type: website\nwebsite:\n title: t\n sidebar:\n style: floating\n contents: [a.qmd, b.qmd, c.qmd]\nformat:\n html:\n toc: true\n' > _quarto.yml
printf -- '---\ntitle: A\n---\n\n## One\n\ntext\n\n## Two\n\ntext\n' > a.qmd
printf -- '---\ntitle: B\n---\n\nNo headings here.\n' > b.qmd
printf -- '---\ntitle: C\ntoc: false\n---\n\n## One\n\ntext\n' > c.qmd
q2 render
for p in a b c; do
echo "$p: $(grep -o '<body class="[^"]*"' _site/$p.html) margin-sidebar=$(grep -c 'id="quarto-margin-sidebar"' _site/$p.html)"
done
Open _site/a.html and _site/b.html in a browser wider than 992px and switch between them.
The sidebar moves.
Actual behavior
With q2 0.47.0 and with 0.45.0-nightly.20261112:
a: <body class="nav-sidebar floating quarto-light" margin-sidebar=1
b: <body class="nav-sidebar floating fullcontent quarto-light" margin-sidebar=0
c: <body class="nav-sidebar floating fullcontent quarto-light" margin-sidebar=0
Expected behavior
The same as Quarto 1.11.9, with the same files and quarto render:
a: <body class="nav-sidebar floating quarto-light" margin-sidebar=1
b: <body class="nav-sidebar floating quarto-light" margin-sidebar=1
c: <body class="nav-sidebar floating fullcontent quarto-light" margin-sidebar=0
Page b has no headings, but because toc is on it keeps the margin sidebar and the
body.floating grid. Only page c, which sets toc: false, gets fullcontent.
Workaround
We give body.nav-sidebar.floating.fullcontent .page-columns the theme's body.floating
grid-template-columns values, for min-width: 992px and for 768px–991.98px. This copies
the theme's grid values, so it can drift when the theme changes.
Environment
- q2 0.47.0 (latest release) and 0.45.0-nightly.20261112, macOS arm64
- Quarto 1.11.9 for the comparison
- Same result with the
posit-dev/product-doc-theme@q2(posit-docs) extension, and with the
plainwebsiteproject type in the repro above
- 主要言語
- Rust
- スター
- 316
- フォーク
- 23
- 平均マージ
- 11時間 49分
- マージ済み PR(30日)
- 245
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`対応中かも @cscheid が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1419 ·
メンテナーはふだん 1 日以内に返信
-
bug testing windows
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1346 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/q2#1095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug readers-writers windows
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
quarto-dev/q2#1416 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Most knitr engines are not yet supported: {cat}, {css}, {Rcpp}... cells go to Jupyter対応中かも @cderv が 3 日前に担当しました。 オープンfeature-port
quarto-dev/q2#1413 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
BurntSushi/jiff#755 ·
メンテナーはふだん 1 日以内に返信
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status lineオープンbug help wanted priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sawhorse3d/sawhorse#163 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
MartinPTielemans/ilo#4607 ·