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

Aberta Para iniciantes
#37 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
1/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
85/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
markdown, python, yaml

Direção de pesquisa

O aviso vem do bloco do plugin git-revision-date-localized em mkdocs.yml:48; leia essas configurações primeiro, depois reproduza criando um docs/resources/TEST.md não rastreado, executando python scripts/prepare-mkdocs.py, e então mkdocs build --strict. Tente enable_creation_date: false ali e confirme que a mesma build agora passa, depois compare as datas de uma página renderizada com a saída atual para verificar que nada além de "Created" desaparece. Pronto quando a página não rastreada compilar em modo strict e a CI continuar verde.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
2
Forks
5
Merge médio
2d 17h
PRs com merge (30d)
6

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Awesome-Ads

Todas as issues de TMHSDigital/Awesome-Ads

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.