Empty page.md files are published and listed in the sitemap
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, next.js
- Ambito
- backend, build-system
Direzione di ricerca
Start with src/app/sitemap.js to see how fast-glob matches page files, then inspect the prebuild scripts and check-changelog.mjs for the existing check pattern. Add coverage for empty or front-matter-only page.md files under src/app; verify the sitemap excludes them and yarn build fails naming the file, while non-empty sitemap entries remain unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Any empty page.md under src/app (including the docs overlaid from gofr-dev/gofr at deploy time) is published as a route and listed in sitemap.xml. Today this publishes a blank page at https://gofr.dev/docs/quick-start/cli: HTTP 200, the site chrome with nothing in the content area, a generic title, and a sitemap entry that tells search engines to index it.
Cause
src/app/sitemap.js collects routes with fast-glob over src/app/**/page.md, page.jsx and page.tsx and adds every match; it never checks that the file has content. Next.js renders an empty Markdoc file as an empty page rather than failing the build, so nothing flags it.
The source file is docs/quick-start/cli/page.md in gofr-dev/gofr (zero bytes). Fixing that file is tracked in gofr-dev/gofr; this issue is about the website not publishing or indexing such pages in the first place.
Steps to reproduce
curl -s -o /dev/null -w '%{http_code} %{size_download}\n' https://gofr.dev/docs/quick-start/cligives200with only the page shell.curl -s https://gofr.dev/sitemap.xml | grep quick-start/clishows the URL.
Expected behavior
An empty content file is not listed in the sitemap, and the build fails (or at least warns loudly) so it is noticed before deploy.
Proposed solution
- In
sitemap.js, skippage.mdfiles whose size is zero (or whose content is only front matter). - Add a small check to the
prebuildstep (next tocheck-changelog.mjs) that fails the build when an emptypage.mdis found undersrc/app.
Acceptance criteria
- An empty
page.mdis not insitemap.xml. -
yarn buildfails with a message naming the empty file. - Non-empty pages are unaffected (sitemap URL count unchanged otherwise).
- Lingua principale
- JavaScript
- Stelle
- 44
- Fork
- 44
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gofr-dev/website
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Homepage HTML shows "Trusted by 0+ Developers" to crawlersForse già presa @thzgajendra l’ha presa 38 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Dockerfile builder stage pins node:23.11.1 — a non-LTS line, EOL since 2025-06-01Forse già presa @akshat-kumar-singhal l’ha presa 98 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
-
Add og:image preview cards to docs pagesForse già presa @adamshatzkamer l’ha presa 36 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
Tutte le issue di gofr-dev/website
Issue simili
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtagForse già presa @bardrop l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nbd-wtf/nostr-tools#578 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
h5bp/html5-boilerplate#3512 ·
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
githubnext/gh-aw-workshop#5752 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno