Add date to posts list on homepage

This commit is contained in:
Emi Matchu 2024-09-11 20:37:18 -07:00
parent 651d1318c3
commit ebd1b5319c
2 changed files with 26 additions and 2 deletions

View file

@ -92,6 +92,26 @@ article {
} }
} }
.posts {
time {
font-size: 0.85em;
font-style: italic;
margin-left: 0.25em;
&:before {
content: "(";
}
&:after {
content: ")";
}
}
p {
margin-block: 0.5em;
}
}
/* A font by Jos Buivenga (exljbris) -> www.exljbris.nl */ /* A font by Jos Buivenga (exljbris) -> www.exljbris.nl */
@font-face { @font-face {
font-family: Delicious; font-family: Delicious;

View file

@ -3,11 +3,15 @@ layout: default
title: "Home" title: "Home"
--- ---
<ul> <ul class="posts">
{% for post in site.posts %} {% for post in site.posts %}
<li> <li>
<a href="{{ post.url }}">{{ post.title }}</a> <a href="{{ post.url }}">{{ post.title }}</a>
{{ post.excerpt }} {% if post.date %}
<time datetime="{{ post.date | date_to_xmlschema }}"
>{{ post.date | date_to_string: "ordinal", "US" }}</time
>
{% endif %} {{ post.excerpt }}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>