Skip to content

Commit 07c0c2f

Browse files
committed
templates: Show latest blog posts inline on the homepage
The blog previously only showed up via the nav link to /blog; you had to know it existed. Surface the 3 most recent posts (title + date) directly in the homepage content, right below the overview text, with a link through to the full archive. Assisted-by: AI
1 parent 261473a commit 07c0c2f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎templates/index.html‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ <h3 class="title-text text-center">
4545
/>
4646
{% endblock fonts %}
4747

48+
{% block content %}
49+
<div id="features" class="heading-text">Overview</div>
50+
{{ section.content | safe }}
51+
52+
<div class="heading-text">Latest from the Blog</div>
53+
<ul>
54+
{% set blog = get_section(path="blog/_index.md") %}
55+
{% for post in blog.pages | slice(end=3) %}
56+
<li>
57+
<a href="{{ post.permalink | safe }}">
58+
<strong class="title article-title">{{ post.title }}</strong>
59+
</a>
60+
<div>
61+
<span class="subtext">{{ post.date | date(format="%B %d, %Y") }}</span>
62+
</div>
63+
</li>
64+
{% endfor %}
65+
</ul>
66+
<p><a href="{{ get_url(path="blog") }}">See all posts&nbsp;&raquo;</a></p>
67+
{% endblock content %}
68+
4869
{% block sidebar %}
4970
<div class="sidebar">
5071
</div>

0 commit comments

Comments
 (0)