Files
blog/_layouts/xslt_container.html
T

48 lines
1.4 KiB
HTML
Raw Normal View History

2025-06-25 06:13:37 +00:00
{% if page.layout == "xslt" %}<?xml version="1.0" encoding="utf-8"?>
2025-06-25 11:29:21 +00:00
<?xml-stylesheet type="text/xml" href="/feed.xslt.xml"?>
2025-06-25 05:43:23 +00:00
<xsl:stylesheet
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">
2025-06-25 07:00:08 +00:00
<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes" doctype-system="about:legacy-compat" />
2025-06-25 05:43:23 +00:00
<xsl:template match="/">
{{ content }}
</xsl:template>
<xsl:template match="atom:feed/atom:entry">
<div class="item">
<h2>
<a>
<xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
<xsl:value-of select="atom:title"/>
</a>
</h2>
<small class="gray">
Published at <xsl:value-of select="substring(atom:published, 0, 11)" />
</small>
<p><xsl:value-of select="atom:summary"/></p>
<hr />
</div>
</xsl:template>
<xsl:template match="/rss/channel/item">
<div class="item">
<h2>
<a>
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</h2>
<small class="gray">
Published at <xsl:value-of select="substring(pubDate, 0, 17)" />
</small>
<p><xsl:value-of select="description"/></p>
<hr />
</div>
</xsl:template>
</xsl:stylesheet>
2025-06-25 06:45:14 +00:00
{% else %}<!DOCTYPE html>
{{ content }}
2025-06-25 05:43:23 +00:00
{% endif %}