Skip to content

Commit

Permalink
Wrap dates in <time> tags with datetime attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
helenclx committed Sep 5, 2024
1 parent b4d43fd commit e7551f0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/_includes/blog/postslist.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% endif %}
</a>
</p>
<p>{{ post.date | niceDate }}</p>
<time datetime="{{ post.date }}">{{ post.date | niceDate }}</time>
</li>
{% endfor %}
</ul>
4 changes: 2 additions & 2 deletions src/_includes/global/content.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ layout: global/base
<p>{{ desc }}</p>
<p>
<span class="text-bold">{{ content | wordcount | thousands }} words</span>.
<span class="text-bold">Posted:</span> {{ date | niceDate }} by {{ sitemeta.siteAuthor.name }}
<span class="text-bold">Posted:</span> <time datetime="{{ date }}">{{ date | niceDate }}</time> by {{ sitemeta.siteAuthor.name }}
</p>
{% if updated %}
<p><span class="text-bold">Last Updated:</span> {{ updated | niceDate }}</p>
<p><span class="text-bold">Last Updated:</span> <time datetime="{{ updated }}">{{ updated | niceDate }}</time></p>
{% endif %}
<p><span class="text-bold">Categories:</span>
{% for cat in categories %}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/global/statement.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ layout: global/content

{{ content | safe }}

<p>(This {{ keyword }} was last updated on {{ updated | niceDate }})</p>
<p>(This {{ keyword }} was last updated on <time datetime="{{ updated }}">{{ updated | niceDate }}</time>)</p>
2 changes: 1 addition & 1 deletion src/pages/blog.njk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ eleventyComputed:
{% endif %}
</a>
</h2>
<p class="blog__post--time">{{ post.date | niceDate }}</p>
<time datetime="{{ post.date }}" class="blog__post--time">{{ post.date | niceDate }}</time>
<p>{{ post.data.desc }}</p>
</li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/now.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ eleventyNavigation:
order: 2
---

*This page was last updated on {{ updated | niceDate }}.*
*This page was last updated on <time datetime="{{ updated }}">{{ updated | niceDate }}</time>.*

This is my [/now page](https://nownownow.com/about), which highlights what I am doing and focusing on at the moment. You can find more pages like this at [nownownow.com](https://nownownow.com/).

Expand Down

0 comments on commit e7551f0

Please sign in to comment.