summary refs log tree commit diff
path: root/_layouts/xslt_container.html
blob: ef45d5f9efc1c6720898eee7b497c3e828798f91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{% 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="/">
      {{ 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>
{% else %}<!DOCTYPE html>
{{ content }}
{% endif %}