Jekyll Ignoring Date Format

I’m having trouble getting the date format I want which is:
<Weekday>, <Month> <dd>, <yyyy>

Desired output:

Monday, November 9, 2021
Wednesday, December 15, 2021

On the landing page (_layouts/topics.html), where each post is listed, this is the relevant code:

<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
	{%- assign date_format = site.minima.date_format | default: "%A, %B %-d, %Y" -%}
	{{ page.date | date: date_format }}
</time>

And the same thing appears in the posts template (_layouts/post.html):

<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
	{%- assign date_format = site.minima.date_format | default: "%A, %B %-d, %Y" -%}
	{{ page.date | date: date_format }}
</time>

Both of these are being ignored. I can think of two possible reasons:

  • date_to_xmlschema overrides the assign statement, or
  • another minimal config file further up the chain is overriding.

Things I’ve Tried

  • adding a date: directive to the front matter of a few *.md files, and
  • adding this line to _config.ymldate: "%A, %B %-d, %Y"

If this isn’t enough information to allow diagnosing this problem, please let me know. Thanks in advance.

UPDATE
I changed the line in _config.yml to:

date_format: "%A, %B %-d, %Y"

and now I’m getting the desired format on post pages, but still not getting it on topics.html.

UPDATE 2
Got it sorted. I’d overlooked the date format in _layouts/home.html. Now it’s all working.

2 Likes