Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog post date-only format #7001

Closed
4 tasks done
alexvoss opened this issue Apr 1, 2024 · 2 comments
Closed
4 tasks done

Blog post date-only format #7001

alexvoss opened this issue Apr 1, 2024 · 2 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@alexvoss
Copy link
Sponsor Collaborator

alexvoss commented Apr 1, 2024

Context

Use of the blog plugin without further settings.

Bug description

As discussed in #6998 (reply in thread), the post date by default contains a time was well, which is set to 12:00AM. It should display only a date, regardless of whether the page header contains only a date or a date and time. This has also been observed in #6996.

While is is possible to fix this through customization, the default should be only the date.

Note that the default was date only as late as 9.5.13+insiders.4.53.1.

Related links

Reproduction

9.5.16+insiders.4.53.4-datetime-blog.zip

Steps to reproduce

  1. mkdocs serve
  2. navigate to http://localhost:8000/blog/
  3. Observe the date and time in the blog index
  4. Click though to the blog post itself
  5. Observe the data and time in the post metadata

Browser

No response

Before submitting

@squidfunk
Copy link
Owner

Thanks for reporting. This is a regression of accepting and merging #6981, which switched to format_datetime instead of format_date. The predefined format long will now refer to a format string that includes the time. Rendering the blog post without time should be the default, as our current assumption is that that's what most users would expect.

1041766 adds a condition that checks if the author uses one of the predefined time formats, the blog plugin should use format_date. However, if a custom string is given, the plugin will make use of format_datetime, so we allow explicitly opting into using format strings including time. This still fixes #6981 but allows us to keep sensible defaults.

@squidfunk squidfunk added bug Issue reports a bug resolved Issue is resolved, yet unreleased if open labels Apr 2, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants