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> <description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
<pubDate>{{ post.date | dateToRfc822 }}</pubDate> <pubDate>{{ post.date | dateToRfc822 }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator> <dc:creator>{{ metadata.author.name }}</dc:creator>
<atom:summary>{{ post.content | excerpt }}</atom:summary>
<guid>{{ absolutePostUrl }}</guid> <guid>{{ absolutePostUrl }}</guid>
</item> </item>
{%- endfor %} {%- endfor %}

View File

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

View File

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

View File

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