Closed mvelikikh closed 2 days ago
I've got a PR to address this here: #7730
As a temporary workaround if you add a timezone i.e. -07:00
or Z
to the end of your dates that have a time, that should get you unblocked.
The workaround I use now is to use 9.5.38. Another workaround is to use dates with time because most of my dates are with times, and only one is yyyy-mm-dd
which is causing issues in 9.5.45 that broke it.
There is no need for a time zone because I don't use it. It is not in the documentation either: https://squidfunk.github.io/mkdocs-material/plugins/blog/#meta.date
@mvelikikh #7730 is merged. Could you please check if the error is fixed for you now?
The workaround I use now is to use 9.5.38. Another workaround is to use dates with time because most of my dates are with times, and only one is
yyyy-mm-dd
which is causing issues in 9.5.45 that broke it. There is no need for a time zone because I don't use it. It is not in the documentation either: https://squidfunk.github.io/mkdocs-material/plugins/blog/#meta.date
Thanks @mvelikikh your workaround is the correct one. Sorry for the churn here, I believe #7730 should address all cases.
@squidfunk I tested and can confirm that it works with the latest changes from https://github.com/squidfunk/mkdocs-material/commit/eee4934efdf21f6d3bc576afd02a63cf96485299 @perpil thanks for fixing this.
Thanks for your time, @perpil! I'll let that sit for 2-3 days to see if we catch another bug, and then issue the next release.
FYI: I experienced the same issue using material for mkdocs 9.5.45 within the GtiHub action used to publish my journal.
My posts all use the yyyy-mm-dd
date format.
Setting the mkdocs-material python package version to 9.5.44 in the GitHub actions workflow file resolves this issue, until the next release is available.
- run: pip install mkdocs-material=="9.5.44" mkdocs-callouts mkdocs-glightbox mkdocs-git-revision-date-localized-plugin mkdocs-redirects mkdocs-rss-plugin pillow cairosvg
Thank you for quickly creating a fix
I'm still receiving this issue using 9.5.46.
Here's the CI run failing: https://ci.codeberg.org/repos/12442/pipeline/205/4 And here's one of the blog posts I have: https://codeberg.org/Andre601/website/src/branch/renovate/mkdocs-material-9.x/docs/blog/posts/2024/11-14-add-fediverse-creator-tag.md
Also, if it is of any importance is here the Pipeline file that is used on PRs: https://codeberg.org/Andre601/website/src/branch/renovate/mkdocs-material-9.x/.woodpecker/pr_preview.yml
This also happens locally on my PC after installing latest mkdocs-material via pip install -U -r requirements.txt
, using the branch with the new version.
If it's the exact same issue, please create a minimal reproduction, and attach it here. If it's slightly different, please create a new issue, including a minimal reproduction of course. We let the fix sit here for two days and no further feedback was provided, so I read that as this issue is fixed now.
The cause is the same (TypeError: can't compare offset-naive and offset-aware datetimes), but stacktrace is different.
Will try to make a minimal reproduction here to see what the issue may be and if reproduced, file a new issue.
Context
No response
Bug description
mkdocs build --strict
fails on 9.5.45 with the error below:9.5.38 works fine. I constructed a minimal reproduction test case, and based on this, the error is thrown when I have two formats of
date.created
:created: 2024-09-06
)created: 2019-02-25T04:25:00
)Both formats are supported per the documentation: https://squidfunk.github.io/mkdocs-material/plugins/blog/#meta.date
If I remove any of the files and keep only one format, there is no error.
Related links
Reproduction
9.5.45-typerror-cannot-compare-datetimes.zip
Steps to reproduce
pip install .
(the reproduction file haspyproject.toml
)mkdocs build --strict
- should fail ❌pip install mkdocs-material==9.5.38
mkdocs build --strict
- should work✔Browser
Firefox
Before submitting