Alexander Payne abfac1a93e Switched to Babel's format_datetime to allow for time in formatted dates (#6981)
* Use Babel's `format_datetime`, not `format_date`

I am using MkDocs-Material 9.5.15 and Babel 2.14.0. When setting the config value `blog.post_date_format: "yyyy-MM-dd hh:mm:ss"`, the blog plugin crashes during compilation with the error "date objects have no hour field".

I believe this is occurring because the plugin provides a `datetime` to `babel.dates.format_date`, which upcasts it to a plain, timeless, `date`. Making this change to use `babel.dates.format_datetime` instead resolved the error and demonstrated expected behavior.

While I recognize that it is likely uncommon for a blog to want to include sub-date timestamps in any of these fields, I believe that the current documentation,

> The format string must adhere to babel's pattern syntax and should not contain whitespace

implies that _any_ of Babel's pattern markers are acceptable here. I would consider 

> The format string must adhere to Babel's pattern syntax for calendar dates and should not contain whitespace

to also be a sufficient fix for this case.

----

Thank you for your effort in creating this project; it has been a wonderful benefit to my team, and this is the first minor problem we've had in months of using it.

* Make the change in src/, not material/
2024-03-31 15:45:47 +08:00
2023-07-07 09:37:30 +02:00
2024-03-06 13:22:40 +07:00
2023-10-06 15:18:28 +02:00
2024-03-27 18:11:52 +08:00
2024-02-19 12:48:18 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00
2023-09-25 17:36:36 +02:00
2024-03-23 13:38:07 +08:00
2023-09-21 15:57:54 +02:00
2024-03-13 09:14:16 +07:00
2024-01-06 09:27:06 +07:00
2024-03-27 18:11:52 +08:00
2024-03-27 18:11:52 +08:00
2024-02-07 10:32:47 +07:00
2024-03-06 13:22:40 +07:00
2024-01-06 09:27:06 +07:00
2024-01-06 09:27:06 +07:00

Material for MkDocs

A powerful documentation framework on top of MkDocs

Build Downloads Python Package Index Docker Pulls Sponsors

Write your documentation in Markdown and create a professional static site for your Open Source or commercial project in minutes searchable, customizable, more than 60 languages, for all devices.

Check out the demo squidfunk.github.io/mkdocs-material.

 

Silver sponsors

 

Bronze sponsors

 

Everything you would expect

It's just Markdown

Focus on the content of your documentation and create a professional static site in minutes. No need to know HTML, CSS or JavaScript let Material for MkDocs do the heavy lifting for you.

Works on all devices

Serve your documentation with confidence Material for MkDocs automatically adapts to perfectly fit the available screen estate, no matter the type or size of the viewing device. Desktop. Tablet. Mobile. All great.

Made to measure

Make it yours change the colors, fonts, language, icons, logo, and more with a few lines of configuration. Material for MkDocs can be easily extended and provides many options to alter appearance and behavior.

Fast and lightweight

Don't let your users wait get incredible value with a small footprint by using one of the fastest themes available with excellent performance, yielding optimal search engine rankings and happy users that return.

Built for everyone

Make accessibility a priority users can navigate your documentation with touch devices, keyboards, and screen readers. Semantic markup ensures that your documentation works for everyone.

Open Source

Trust 20,000+ users choose a mature and actively maintained solution built with state-of-the-art Open Source technologies. Keep ownership of your content without fear of vendor lock-in. Licensed under MIT.

Quick start

Material for MkDocs can be installed with pip:

pip install mkdocs-material

Add the following lines to mkdocs.yml:

theme:
  name: material

For detailed installation instructions, configuration options, and a demo, visit squidfunk.github.io/mkdocs-material

Trusted by ...

... industry leaders

ArXiv, Atlassian, AWS, Bloomberg, CERN, CloudFlare, Datadog, Google, Hewlett Packard, ING, Intel, JetBrains, LinkedIn, Microsoft, Mozilla, Netflix, Red Hat, Salesforce, SIEMENS, Slack, Square, Zalando

... and successful Open Source projects

Arduino, Auto-GPT, AutoKeras, BFE, CentOS, Crystal, Electron, FastAPI, GoReleaser, Knative, Kubernetes, kSQL, Nokogiri, OpenFaaS, Percona, Pi-Hole, Pydantic, PyPI, Renovate, Traefik, Trivy, Vapor, ZeroNet, WebKit, WTF

License

MIT License

Copyright (c) 2016-2024 Martin Donath

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Description
No description provided
Readme 155 MiB
Languages
HTML 31.1%
TypeScript 27.1%
Python 25.3%
SCSS 15.7%
CSS 0.6%
Other 0.2%