On This Day

Hello,

I am trying to figure out how to make On This Day with my current theme. As far as I understand the Micromeories code just discovers and crawls your /archive page and populates the content, so as long as you have an /archive page, in theory, and as I barely understand it, should work. It was working on the first iteration of the theme (Outpost), then it stopped. On the second iteration of the theme, all that was added was support for clickable categories links.

So, again, I am trying to figure out or understand what I may need to change (or add) in the theme’s template to make it work again.

Thanks!

The theme needs to include the dt-published microformat in the template for single posts. So, on this page, for example, instead of

<p class="u-url date">Friday October 20, 2023</p>

you should have something like

<p>
  <time class="dt-published" datetime="2023-10-20T14:03:28-0600">Friday October 20, 2023</time>
</p>

Ha! That’s all there is to it? I’ll try it when I get home. Thank you!

Can’t promise you that 100%, I only executed the Python code in my brain, not on an actual computer. :blush: But it looks like it should be alright if you add dt-published to the post template.

Just to make sure I wont be braking anything important, this is how it currently is in the template.

<p class="u-url date">{{ .Date.Format "Monday January 2, 2006" }}</p>

I should change it to

<p class="dt-published">{{ .Date.Format "Monday January 2, 2006" }}</p>

or exactly as you described up there?

You can always revert your changes if something breaks. I think you need my version, though.

What’s there already is a bit weird, as it is marked up as a URL when it’s not. :slight_smile:

Okay, And I don’t change anything from your script above? I copied and pasted it exactly as is, and “it works” is just weird. It labels every post as of October 20, 2023, but also, I am not sure if the posts showing are actually from 10/23 of previous years.

Thank you, again!

You need to use the go convention for time. I also wouldn’t use a <p> class for time. Instead, I’d do the following:

 <time
  class = "date dt-published"
  datetime = "{{ .Date.Format "January 02, 2006 15:04:05  -0700" }}" >
    <a class = "u-url" href= "{{ .Permalink }}">
      {{ .Date.Format "Monday January 2, 2026" }}
    </a>
</time>
3 Likes

Thank you, Jason, I’ll try it. :smiley: