diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
| commit | f4fcda54638685899c730b3fa90a87d80d6dbef5 (patch) | |
| tree | 0737e627cce304c3a9c4e757bc5f6571a7456091 /sysret.org/themes/tabi-lean/static/sitemap_style.xsl | |
| parent | d8b9cf1f61cc07d625f1c37ccc28adfd58918416 (diff) | |
| parent | 2c13119932765c6d788f08fb53abc244407c0d80 (diff) | |
Merge commit '6a7d3111b31e73fc66af5360149d41f690fbcaa4'
Diffstat (limited to 'sysret.org/themes/tabi-lean/static/sitemap_style.xsl')
| -rw-r--r-- | sysret.org/themes/tabi-lean/static/sitemap_style.xsl | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sysret.org/themes/tabi-lean/static/sitemap_style.xsl b/sysret.org/themes/tabi-lean/static/sitemap_style.xsl new file mode 100644 index 0000000..70c3bb4 --- /dev/null +++ b/sysret.org/themes/tabi-lean/static/sitemap_style.xsl @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="2.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"> + <xsl:output method="html" encoding="UTF-8" indent="yes" /> + + <!-- The base URL is assumed to be the first URL in the sitemap. --> + <xsl:variable name="baseUrl" select="(sitemap:urlset/sitemap:url)[1]/sitemap:loc"/> + <!-- Remove http[s]:// --> + <xsl:variable name="baseUrlWithoutProtocol" select="substring-after($baseUrl, '://')"/> + <!-- Remove trailing slash --> + <xsl:variable name="clean_base_url" select="substring-before($baseUrlWithoutProtocol, '/')"/> + + <xsl:template match="/sitemap:urlset"> + <html> + <head> + <title>Sitemap • <xsl:value-of select="$clean_base_url"/></title> + <link rel="stylesheet" href="{$baseUrl}main.css"/> + <script src="{$baseUrl}js/sortTable.min.js" defer="defer"></script> + </head> + <body> + <div class="full-width"> + <h1>Sitemap of <xsl:value-of select="$clean_base_url"/></h1> + <p>Number of URLs: <xsl:value-of select="count(sitemap:url)"/></p> + <table id="sitemapTable" class="sitemap-table" aria-label="URLs on the site and their last modification dates"> + <thead> + <tr> + <th><span class="columntitle">URL</span></th> + <th><span class="columntitle">Last modification</span></th> + </tr> + </thead> + <tbody> + <xsl:for-each select="sitemap:url"> + <tr> + <td> + <a href="{sitemap:loc}"> + <xsl:value-of select="sitemap:loc"/> + </a> + </td> + <td> + <xsl:value-of select="sitemap:lastmod"/> + </td> + </tr> + </xsl:for-each> + </tbody> + </table> + </div> + </body> + </html> + </xsl:template> +</xsl:stylesheet> |
