Skip to content

Commit

Permalink
refactor: Only show live posts in Wagtail
Browse files Browse the repository at this point in the history
  • Loading branch information
hepplerj committed Nov 18, 2024
1 parent 2c59f39 commit ead4293
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions essays/templates/essays/essay_index_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>{{ page.title }}.</h1>
<div class="text-xl pb-8">{{ page.intro|richtext }}</div>

<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 p-6">
{% for post in page.get_children %}
{% for post in page.get_children.live %}
<div
class="bg-white border border-gray-200 rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-200">
{% if post.specific.preview_image %}
Expand All @@ -26,7 +26,8 @@ <h1>{{ page.title }}.</h1>
</div>
{% endif %}
<div class="p-4">
<h2 class="text-xl font-semibold mb-2"><a href="{% pageurl post %}" class="text-black underline hover:no-underline">{{ post.title }}</a></h2>
<h2 class="text-xl font-semibold mb-2"><a href="{% pageurl post %}"
class="text-black underline hover:no-underline">{{ post.title }}</a></h2>
{% if post.specific.author %}
<p class="text-gray-700 mb-2">by {{ post.specific.author }}</p>
{% endif %}
Expand All @@ -39,4 +40,4 @@ <h2 class="text-xl font-semibold mb-2"><a href="{% pageurl post %}" class="text-
</div>
</div>
</div>
{% endblock content %}
{% endblock content %}

0 comments on commit ead4293

Please sign in to comment.