about summary refs log tree commit diff homepage
path: root/page.xslt
diff options
context:
space:
mode:
Diffstat (limited to 'page.xslt')
-rw-r--r--page.xslt49
1 files changed, 49 insertions, 0 deletions
diff --git a/page.xslt b/page.xslt
new file mode 100644
index 0000000..a739083
--- /dev/null
+++ b/page.xslt
@@ -0,0 +1,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>