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

Open Beginner friendly
#37 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown, python, yaml

Research direction

The warning comes from the git-revision-date-localized plugin block at mkdocs.yml:48; read those settings first, then reproduce by creating an untracked docs/resources/TEST.md, running python scripts/prepare-mkdocs.py, then mkdocs build --strict. Try enable_creation_date: false there and confirm the same build now passes, then compare a rendered page's dates against the current output to check nothing but "Created" disappears. Done when the untracked page builds strictly and CI is still green.

Written by the indexing model from the issue text.

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

Dominant language
Python
Stars
2
Forks
5
Avg merge
2d 17h
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/Awesome-Ads

All issues in TMHSDigital/Awesome-Ads

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.