logo

blog

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

bookmarks.xsl.in (2370B)


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xml:space="preserve">
  3. <xsl:import href="templates/en/nav.xsl" />
  4. <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
  5. <xsl:template match="/xbel"><xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
  6. <html xml:lang="en" lang="en">
  7. <head>
  8. <xi:include href="templates/head.xml" parse="xml" xpointer="xpointer(/xml/*)"/>
  9. <title>Bookmarks - lanodan's cyber-home</title>
  10. </head>
  11. <body>
  12. <xsl:call-template name="nav"/>
  13. <main>
  14. <h1>Bookmarks</h1>
  15. <p>
  16. This is generated from <a href="/bookmarks.xbel">/bookmarks.xbel</a>, a standard-compliant <a href="http://pyxml.sourceforge.net/topics/xbel/">XBEL</a> file, which you can process and import in some browsers. (XSLT file used for it: <a href="/bookmarks.xsl">/bookmarks.xsl</a>).<br />
  17. An Atom syndication feed is also available at <a rel="alternate" type="application/atom+xml" href="/bookmarks.atom">/bookmarks.atom</a> if you want to get updates about new entries.<br />
  18. It currently contains <xsl:number value="count(//bookmark)"/> links organised in <xsl:number value="count(//folder)"/> folders.
  19. </p>
  20. <details id="toc" open="">
  21. <summary>Table of Contents <a href="#toc">§</a></summary>
  22. <ul><xsl:for-each select="/xbel/folder">
  23. <li><a href="#{title}"><xsl:value-of select="title" /></a></li></xsl:for-each>
  24. </ul>
  25. </details>
  26. <xsl:apply-templates select="/xbel/folder"/>
  27. <section id="Misc">
  28. <h2>Misc <a href="#Misc">§</a></h2>
  29. <dl><xsl:apply-templates select="/xbel/bookmark"/>
  30. </dl>
  31. </section>
  32. </main>
  33. <xi:include href="templates/en/footer.shtml" parse="xml"/>
  34. </body>
  35. </html></xsl:template>
  36. <xsl:template match="folder">
  37. <section id="{title}">
  38. <h2><xsl:value-of select="title" />&#x0020;<a href="#{title}">§</a></h2>
  39. <xsl:if test="desc"><p><xsl:value-of select="desc" /></p>
  40. </xsl:if><dl><xsl:apply-templates select="bookmark"/>
  41. </dl>
  42. </section></xsl:template>
  43. <xsl:template match="bookmark">
  44. <dt><a rel="external noreferrer" href="{@href}"><xsl:value-of select="title" /></a></dt><xsl:if test="desc"><dd><xsl:value-of select="desc" /></dd></xsl:if></xsl:template>
  45. </xsl:stylesheet>