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.

51 lines
1.5 KiB

  1. {% if page.layout == "xslt" %}<?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet
  3. version="3.0"
  4. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5. xmlns:atom="http://www.w3.org/2005/Atom">
  6. <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
  7. <xsl:template match="/">
  8. <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ site.lang | default: "zh-CN" }}">
  9. {{ content }}
  10. </html>
  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:stylesheet>
  47. {% else %}
  48. <!DOCTYPE html>
  49. <html lang="{{ site.lang | default: "zh-CN" }}">
  50. {{ content }}
  51. </html>
  52. {% endif %}

Powered by TurnKey Linux.