Only show the latest 5 posts
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m54s

This commit is contained in:
Lewis Dale 2024-04-11 07:34:50 +01:00
parent b86ceda191
commit 435800af35
4 changed files with 5 additions and 3 deletions

View File

@ -23,6 +23,7 @@ eleventyImport:
<description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator>
<atom:summary>{{ post.content | excerpt }}</atom:summary>
<guid>{{ absolutePostUrl }}</guid>
</item>
{%- endfor %}

View File

@ -31,7 +31,7 @@ eleventyExcludeFromCollections: true
</section>
<section>
<h2>Recent Items</h2>
<xsl:apply-templates select="atom:feed/atom:entry" />
<xsl:apply-templates select="atom:feed/atom:entry[position() &lt; 6]" />
</section>
</body>
</html>

View File

@ -32,7 +32,7 @@ eleventyExcludeFromCollections: true
</section>
<section>
<h2>Recent Items</h2>
<xsl:apply-templates select="rss/channel/item" />
<xsl:apply-templates select="//*[local-name()='item'][position() &lt; 6]" />
</section>
</body>
</html>
@ -72,7 +72,7 @@ eleventyExcludeFromCollections: true
</a>
</h3>
<p>
<xsl:value-of select="description" disable-output-escaping="yes" />
<xsl:value-of select="atom:summary" disable-output-escaping="yes" />
</p>
<small>
Published: <xsl:value-of select="pubDate" />

View File

@ -27,6 +27,7 @@ eleventyImport:
<description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator>
<atom:summary>{{ post.content | excerpt }}</atom:summary>
<guid>{{ absolutePostUrl }}</guid>
</item>
{%- endfor %}