logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/

atom.xsl.in (1974B)


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns="http://www.w3.org/1999/xhtml"
  5. xmlns:xhtml="http://www.w3.org/1999/xhtml"
  6. xmlns:xi="http://www.w3.org/2001/XInclude"
  7. xmlns:atom="http://www.w3.org/2005/Atom"
  8. xml:space="preserve"
  9. >
  10. <xsl:import href="templates/en/nav.xsl" />
  11. <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
  12. <xsl:template match="/"><xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
  13. <html xml:lang="en" lang="en">
  14. <head>
  15. <xi:include href="templates/head.xml" parse="xml" xpointer="xpointer(/xml/*)"/>
  16. <title><xsl:value-of select="/atom:feed/atom:title" /></title>
  17. </head>
  18. <body>
  19. <xsl:call-template name="nav">
  20. <xsl:with-param name="feedURL" select="/atom:feed/atom:link[@rel='self']/@href"/>
  21. </xsl:call-template>
  22. <main>
  23. <h1><xsl:value-of select="/atom:feed/atom:title" /></h1>
  24. <p>This is an Atom feed, you can regularly pull updates from it via a <a href="https://en.wikipedia.org/wiki/Feedreader">feedreader</a> and <a href="{/atom:feed/atom:link[@rel='self']/@href}">this feed's URL</a>. Included below are entries included in it, rendered without their included content for simplicity.</p>
  25. <xsl:apply-templates select="/atom:feed/atom:entry"/>
  26. </main>
  27. <xi:include href="templates/en/footer.shtml" parse="xml"/>
  28. </body>
  29. </html></xsl:template>
  30. <xsl:template match="atom:entry">
  31. <a href="{atom:id}"><h2><xsl:value-of select="atom:title"/></h2></a>
  32. <p class="timestamps"><xsl:apply-templates select="atom:published"/><xsl:apply-templates select="atom:updated"/></p>
  33. <xsl:if test="atom:content[@type='text']"><p><xsl:value-of select="atom:content"/></p></xsl:if>
  34. </xsl:template>
  35. <xsl:template match="atom:published">published on <xsl:value-of select="."/></xsl:template>
  36. <xsl:template match="atom:updated">, last updated on <xsl:value-of select="."/></xsl:template>
  37. </xsl:stylesheet>