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.

52 lines
1.5 KiB

  1. {% if page.layout == "xslt" %}
  2. <?xml version="1.0" encoding="utf-8"?>
  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. <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
  8. <xsl:template match="/">
  9. <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ site.lang | default: "zh-CN" }}">
  10. {{ content }}
  11. </html>
  12. </xsl:template>
  13. <xsl:template match="atom:feed/atom:entry">
  14. <div class="item">
  15. <h2>
  16. <a>
  17. <xsl:attribute name="href">
  18. <xsl:value-of select="atom:link/@href"/>
  19. </xsl:attribute>
  20. <xsl:value-of select="atom:title"/>
  21. </a>
  22. </h2>
  23. <small class="gray">
  24. Published at <xsl:value-of select="substring(atom:published, 0, 11)" />
  25. </small>
  26. <p><xsl:value-of select="atom:summary"/></p>
  27. <hr />
  28. </div>
  29. </xsl:template>
  30. <xsl:template match="/rss/channel/item">
  31. <div class="item">
  32. <h2>
  33. <a>
  34. <xsl:attribute name="href">
  35. <xsl:value-of select="link"/>
  36. </xsl:attribute>
  37. <xsl:value-of select="title"/>
  38. </a>
  39. </h2>
  40. <small class="gray">
  41. Published at <xsl:value-of select="substring(pubDate, 0, 17)" />
  42. </small>
  43. <p><xsl:value-of select="description"/></p>
  44. <hr />
  45. </div>
  46. </xsl:template>
  47. </xsl:stylesheet>
  48. {% else %}
  49. <!DOCTYPE html>
  50. <html lang="{{ site.lang | default: "zh-CN" }}">
  51. {{ content }}
  52. </html>
  53. {% endif %}

Powered by TurnKey Linux.