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

Ouverte Adaptée aux débutants
#37 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
1/5
Temps estimé
1-3 heures
Accessibilité débutants
85/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
markdown, python, yaml

Piste de recherche

L'avertissement provient du bloc du plugin git-revision-date-localized à mkdocs.yml:48 ; lis d'abord ces paramètres, puis reproduis en créant un docs/resources/TEST.md non suivi, en exécutant python scripts/prepare-mkdocs.py, puis mkdocs build --strict. Essaie enable_creation_date: false ici et confirme que la même compilation passe maintenant, puis compare les dates d'une page rendue avec la sortie actuelle pour vérifier que rien d'autre que "Created" ne disparaît. Terminé lorsque la page non suivie se compile en mode strict et que la CI est toujours verte.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Python
Étoiles
2
Forks
5
Merge moyen
2 j 17 h
PR mergées (30 j)
6

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Awesome-Ads

Toutes les issues de TMHSDigital/Awesome-Ads

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.