Pages with categories request listings.json, which 404s when the site has no listing
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript, typescript
Direção de pesquisa
Start with findAndActivateCategories() in quarto.js and updateGlobalListingIndex() in src/project/types/website/listing/website-listing-index.ts; compare the website and standalone rendering paths described in the issue. Check how the script determines whether listings are available and how the index is written. Done means pages with categories and no listings make no failing listings.json request in either case.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
When a page has categories in its title block, quarto.js fetches listings.json to turn the categories into links to a listing (findAndActivateCategories()).
If no listing exists, that file is not there, so every such page makes a request that returns 404 and logs an error in the browser console.
Rendering is not affected, because the script only reads the response when the status is 200.
This happens in two places:
- A website with no listing page.
updateGlobalListingIndex()insrc/project/types/website/listing/website-listing-index.tsonly writeslistings.jsonwhenlistingPaths.length > 0. - A standalone HTML document with
categories. The fetch runs here as well, againstlistings.jsonnext to the document.
For websites, writing listings.json every time (as [] when there are no listings) would remove the 404.
The standalone case would need the script to know whether listings exist before it fetches.
This is mostly cosmetic.
Steps to reproduce
A website with no listing:
# _quarto.yml
project:
type: website
website:
title: "Repro"
---
title: "Home"
categories: [one, two]
---
A page with categories, in a website with no listing.
A standalone document:
---
title: "Standalone"
categories: [one, two]
format: html
---
A standalone document with categories.
Render each one, serve the output over HTTP, open the page and look at the network panel and the console.
Actual behavior
Both pages request listings.json, get a 404, and log Failed to load resource: the server responded with a status of 404 (Not Found) in the console.
Expected behavior
No request for listings.json when there is no listing to link to, and no console error.
Your environment
- OS: macOS 27.0.1.
- Browser: Chromium (Brave), headless.
Quarto check output
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 6f81421488bde28d87cee51c9988e666bc09f7be
- Linguagem predominante
- JavaScript
- Estrelas
- 6.1k
- Forks
- 476
- Merge médio
- 17h 7min
- PRs com merge (30d)
- 112
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de quarto-dev/quarto-cli
-
enhancement websites
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
quarto-dev/quarto-cli#15255 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Website announcement dismiss control cannot be reached or used with a keyboardTalvez já em andamento @Xander-AJ assumiu hoje. Abertaaccessibility bug websites
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
quarto-dev/quarto-cli#15235 ·
Mantenedores costumam responder em até 1 dia
-
quarto.json.decode does not raise on invalid JSON, so pcall cannot catch itTalvez já em andamento @sogav21 assumiu há 1 dia. Abertabug lua
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
quarto-dev/quarto-cli#15226 ·
Mantenedores costumam responder em até 1 dia
-
arrow-dark gives region markers a light band that fails contrastTalvez já em andamento @vav7 assumiu há 1 dia. Abertaaccessibility bug themes
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
quarto-dev/quarto-cli#15222 ·
Mantenedores costumam responder em até 1 dia
-
bug code-annotation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
quarto-dev/quarto-cli#15215 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de quarto-dev/quarto-cli
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
mongoosejs/mquery#142 ·
-
Site Suggestion: bullseyeAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Add toro4n to the data modeling toolsTalvez já em andamento @henriklantzhedstrom-prog assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
neo4j/docs-getting-started#546 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 25 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
libnativeapi/nativeapi#21 ·