about summary refs log tree commit diff homepage
path: root/page.xslt
blob: a739083d42da40d5163151607c687de27c8f10e3 (plain) (blame)
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
48
49
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml">
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
  <xsl:template match="/page">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
      <head>
        <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
        <link rel="alternate" type="application/atom+xml" href="/atom.xml"/>
        <link rel="icon" href="/favicon.png"/>
        <link rel="stylesheet" href="/style.css"/>
        <title>pix by cnx</title>
      </head>
      <body>
        <nav>
          <xsl:if test="@prev != ''"><a href="/{@prev}">PREV</a></xsl:if>
          <h1>PAGE <xsl:value-of select="@curr"/></h1>
          <xsl:if test="@next != ''"><a href="/{@next}">NEXT</a></xsl:if>
        </nav>

        <xsl:for-each select="post">
          <article id="{@id}">
            <h2><a href="#{@id}">
              <xsl:value-of select="translate(@id, '-', ' ')"/>
            </a></h2>
            <xsl:for-each select="picture">
              <a href="{@filename}.jpg">
                <img alt="{@desc}" title="{@desc}" src="{@filename}.small.jpg"/>
              </a><br/>
            </xsl:for-each>
          </article>
        </xsl:for-each>

        <footer>
          <a title="CC BY-SA"
             href="https://creativecommons.org/licenses/by-sa/4.0">
            <xsl:copy-of select="document('cc.svg')/*"/>
            <xsl:copy-of select="document('by.svg')/*"/>
            <xsl:copy-of select="document('sa.svg')/*"/>
          </a>
          <xsl:text> </xsl:text>
          <xsl:value-of select="year"/>
          <xsl:text> </xsl:text>
          <a href="https://cnx.gdn">Nguyễn Gia Phong</a>
        </footer>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>