aider/blog/index.html
Paul Gauthier d7476bb303 aider: Update blog index to display post excerpt if available, otherwise use the first 100 words.
# Aider chat conversation:

USER: use the excerpt if one exists, otherwise keep using the first 100 words

ASSISTANT: ```diff
--- blog/index.html
+++ blog/index.html
@@ ... @@
 <div class="entry">
-    {{ post.content | strip_html | truncatewords: 100 }}...
+    {{ post.excerpt | default: post.content | strip_html | truncatewords: 100 }}...
 </div>
```
2024-02-11 07:52:29 -08:00

18 lines
432 B
HTML

---
layout: default
---
<div class="posts">
{% for post in site.posts %}
<article class="post">
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
<div class="entry">
{{ post.excerpt | default: post.content | strip_html | truncatewords: 100 }}...
</div>
<a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
</article>
{% endfor %}
</div>