diff options
author | mayx | 2025-06-25 05:43:23 +0000 |
---|---|---|
committer | mayx | 2025-06-25 05:43:23 +0000 |
commit | 833fcb15ad09922e080044488c717d4b9065e00d (patch) | |
tree | 5f5d19b416d4ce3828375f5f907f17d9e5ee02af /_layouts/xslt_container.html | |
parent | 2e4dee01e97c27f6e299614195646a18ecbfe16c (diff) |
Update 4 files
- /_layouts/xslt_container.html - /_layouts/default.html - /_layouts/xslt.html - /feed.xslt.xml
Diffstat (limited to '_layouts/xslt_container.html')
-rw-r--r-- | _layouts/xslt_container.html | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/_layouts/xslt_container.html b/_layouts/xslt_container.html new file mode 100644 index 0000000..15acba4 --- /dev/null +++ b/_layouts/xslt_container.html @@ -0,0 +1,53 @@ +{% if page.layout == "xslt" %} +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + version="3.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:atom="http://www.w3.org/2005/Atom"> + <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/> + <xsl:template match="/"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ site.lang | default: "zh-CN" }}"> + {{ content }} + </html> + </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> +{% else %} +<!DOCTYPE html> +<html lang="{{ site.lang | default: "zh-CN" }}"> + {{ content }} +</html> +{% endif %} \ No newline at end of file |