Skip to content

Allow per-post or per-collection date_format values.#5477

Merged
iBug merged 1 commit into
mmistakes:masterfrom
e28eta:date-format-overrides
Apr 29, 2026
Merged

Allow per-post or per-collection date_format values.#5477
iBug merged 1 commit into
mmistakes:masterfrom
e28eta:date-format-overrides

Conversation

@e28eta
Copy link
Copy Markdown
Contributor

@e28eta e28eta commented Apr 27, 2026

This is an enhancement or feature

Summary

Update _include/page__date.html and _include/page__meta.html to read custom date_format values from the page / document object.

Context

I wanted to add a collection to my site, and use a different date format for them (Month Year, omitting the day), and discovered it wasn't a built-in feature.

I think this is a reasonable approach, and seems in line with the recent addition of locale. My specific use case is using the defaults to avoid repeating it in every YAML front matter block:

defaults:
  - scope:
      path: ""
      type: portfolio
    values:
      layout: single
      show_date: true
      date_format: "%B %Y"

Also updating the documentation for this.
@e28eta
Copy link
Copy Markdown
Contributor Author

e28eta commented Apr 27, 2026

For what it's worth, I thought this was already a valid way to set the date format. Back in Dec 2024 I added show_dates: true and a custom date_format to the same block in config's defaults, and apparently never noticed that the date format wasn't what I'd asked for. I must have been skimming this section of the docs, and not realized it was supposed to be a top level key

e28eta/e28eta.github.io@6800dd0

@iBug iBug merged commit e5c4d68 into mmistakes:master Apr 29, 2026
2 checks passed
@e28eta e28eta deleted the date-format-overrides branch April 29, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants