Mayx's Home Page https://mabbs.github.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. {% if page.layout == "xslt" %}<?xml version="1.0" encoding="utf-8"?>
  2. <?xml-stylesheet type="text/xml" href="/feed.xslt.xml"?>
  3. <xsl:stylesheet
  4. version="3.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:atom="http://www.w3.org/2005/Atom"
  7. xmlns:sm="http://www.sitemaps.org/schemas/sitemap/0.9">
  8. <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes" doctype-system="about:legacy-compat" />
  9. <xsl:template match="/">
  10. {{ content }}
  11. </xsl:template>
  12. <xsl:template match="atom:feed/atom:entry">
  13. <div class="item">
  14. <h2>
  15. <a>
  16. <xsl:attribute name="href">
  17. <xsl:value-of select="atom:link/@href"/>
  18. </xsl:attribute>
  19. <xsl:value-of select="atom:title"/>
  20. </a>
  21. </h2>
  22. <small class="gray">
  23. Published at <xsl:value-of select="substring(atom:published, 0, 11)" />
  24. </small>
  25. <p><xsl:value-of select="atom:summary"/></p>
  26. <hr />
  27. </div>
  28. </xsl:template>
  29. <xsl:template match="/rss/channel/item">
  30. <div class="item">
  31. <h2>
  32. <a>
  33. <xsl:attribute name="href">
  34. <xsl:value-of select="link"/>
  35. </xsl:attribute>
  36. <xsl:value-of select="title"/>
  37. </a>
  38. </h2>
  39. <small class="gray">
  40. Published at <xsl:value-of select="substring(pubDate, 0, 17)" />
  41. </small>
  42. <p><xsl:value-of select="description"/></p>
  43. <hr />
  44. </div>
  45. </xsl:template>
  46. <xsl:template match="sm:urlset">
  47. <xsl:for-each select="sm:url">
  48. <li>
  49. <a>
  50. <xsl:attribute name="href"><xsl:value-of select="sm:loc" /></xsl:attribute>
  51. <xsl:value-of select="sm:loc" />
  52. </a>
  53. </li>
  54. </xsl:for-each>
  55. </xsl:template>
  56. </xsl:stylesheet>
  57. {% else %}<!DOCTYPE html>
  58. {{ content }}
  59. {% endif %}

Powered by TurnKey Linux.