Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Sitemap gives 1,003 generated reference pages a lastmod of 0001-01-01

Aperta Adatta ai principianti
#26,373 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
hugo
Ambito
documentation

Direzione di ricerca

Inizia da layouts/sitemap.xml, quindi esamina le pagine generate da content/reference/cli/_content.gotmpl e il comportamento di GitInfo di Hugo. Esegui o esamina il sitemap.xml generato prima di modificare il template; il lavoro è completo quando le pagine di riferimento generate non espongono più <lastmod> come 0001-01-01, mantenendo intatte le date valide. Verifica l’approccio con i maintainer, perché la issue menziona una precedente pull request chiusa e un’alternativa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status/triage
Is this a docs issue?
  • My issue is about the documentation content or website
Type of issue

There's a problem with the website

Description

The sitemap gives 1,003 of its 2,204 entries a <lastmod> of 0001-01-01. For example, docker container run:

<loc>https://docs.docker.com/reference/cli/docker/container/run/</loc>
<lastmod>0001-01-01</lastmod>

Every affected page is a generated reference page: the docker and sbx CLI references, and the Sandboxes, Hub, DVP, AI Governance and Registry API references. Anything that reads the sitemap takes that date at face value, so these pages look like they never change.

As far as I can tell, the cause is that these pages are built by Hugo content adapters such as content/reference/cli/_content.gotmpl, so they have no file in git. With enableGitInfo: true, Hugo takes Lastmod from git, so for these pages it stays at Go's zero time, and layouts/sitemap.xml prints it as is.

Location

https://docs.docker.com/sitemap.xml

Suggestion

One fix is to leave <lastmod> out when the date is zero, which is what Hugo's embedded sitemap template does. The element is optional in the sitemap protocol.

I opened #26365 with that change before filing an issue, which in hindsight was the wrong order. It's closed, and I'm filing this so the problem is tracked either way. I'm happy to rework it if you'd prefer a different approach, such as having the content adapters set a date, or to leave the fix to you.

Lingua principale
Markdown
Stelle
4.7k
Fork
8.5k
Merge medio
2g 7h
PR unite (30g)
133

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di docker/docs

Tutte le issue di docker/docs

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.