Strict site build fails for a new guide until it is committed

Aperta Adatta ai principianti
#37 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à
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
markdown, python, yaml

Direzione di ricerca

L'avviso proviene dal blocco del plugin git-revision-date-localized in mkdocs.yml:48; leggi prima quelle impostazioni, poi riproduci creando un docs/resources/TEST.md non tracciato, eseguendo python scripts/prepare-mkdocs.py, quindi mkdocs build --strict. Prova enable_creation_date: false lì e conferma che la stessa build ora passa, poi confronta le date di una pagina renderizzata con l'output attuale per verificare che non scompaia nulla tranne "Created". Fatto quando la pagina non tracciata compila in modalità strict e la CI è ancora verde.

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

Descrizione

bug good first issue severity: low

Summary

mkdocs build --strict fails for a new page that has not been committed yet. CONTRIBUTING step 5 tells contributors to run this check before they commit (step 6), so anyone adding a guide hits a failure that has nothing to do with their content.

Where

  • mkdocs.yml:48 (git-revision-date-localized plugin settings)
  • CONTRIBUTING.md (step 5, "Verify locally", runs before step 6, "Commit and push")

Details

With a new, untracked docs/resources/<NEW>.md, the revision-date plugin logs:

WARNING - mkdocs_git_revision_date_localized_plugin: First revision timestamp is older than last revision timestamp for page resources/<NEW>.md. This can be due to a quirk in `git` follow behaviour.

--strict turns that warning into a failed build. Once the file is committed, the same build passes. The plugin is already set to strict: false and fallback_to_build_date: true, but this warning is still emitted.

Steps to reproduce

  1. Create docs/resources/TEST.md containing # Test and a line of text. Do not commit it.
  2. Run python scripts/prepare-mkdocs.py and then mkdocs build --strict.
  3. The build aborts on the warning above. Commit the file and run it again: it passes.

Suggested fix

Pick one:

  • Turn off creation dates (enable_creation_date: false). The warning comes from comparing the first and last revision timestamps, which only exist once a file has history.
  • Or add a note to CONTRIBUTING step 5: commit the new page locally before running mkdocs build --strict.

The first is a one-line change. Check that it does not change the dates shown on existing pages beyond removing "Created".

Acceptance criteria

  • A new, uncommitted guide builds with mkdocs build --strict, or CONTRIBUTING says to commit first.
  • CI still passes.

Getting started

  • Relevant files: mkdocs.yml, CONTRIBUTING.md
  • How to check: the steps to reproduce above.

Filed by repo-audit/fix-issues at 3d5ded3. Severity: low. Effort: S. audit-key: bug|mkdocs.yml|git-revision-date-localized

Lingua principale
Python
Stelle
2
Fork
5
Merge medio
2g 17h
PR unite (30g)
6

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 TMHSDigital/Awesome-Ads

Tutte le issue di TMHSDigital/Awesome-Ads

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.