nginx_autoindex.xsl.in (2335B)
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0" xml:space="preserve" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str">
- <!--
- # Do not put $uri/
- try_files $uri $uri/index.html @autoindex;
- location @autoindex {
- autoindex on;
- autoindex_format xml;
- xslt_string_param document_uri "$document_uri";
- xslt_stylesheet /srv/web/hacktivis.me/nginx_autoindex.xsl;
- }
- -->
- <xsl:import href="templates/en/nav.xsl"/>
- <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
- <xsl:template match="/list"><xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <html xml:lang="en" lang="en">
- <head>
- <xi:include href="templates/head.xml" parse="xml" xpointer="xpointer(/xml/*)"/>
- <link rel="stylesheet" href="/css/sorttable.css?serial=2020091801"/>
- <title><xsl:value-of select="$document_uri"/> - lanodan's cyber-home</title>
- </head>
- <body>
- <xsl:call-template name="nav"/>
- <main>
- <table class="sortable">
- <thead>
- <tr><th class="sorttable_sorted">Name</th><th>Size</th><th>Last Modified</th></tr>
- </thead>
- <tbody>
- <xsl:apply-templates select="/list/directory"/>
- <xsl:apply-templates select="/list/file"/>
- </tbody>
- </table>
- </main>
- <xi:include href="templates/en/footer.shtml" parse="xml"/>
- <script src="/javascript/sorttable.js?serial=2023030902"></script>
- </body>
- </html></xsl:template>
- <!--
- <list>
- <directory mtime="2022-07-11T07:56:48Z">ci</directory>
- <file mtime="2020-11-11T11:55:13Z" size="113550">0001-cmake-remove-as-much-as-possible.patch</file>
- </list>
- -->
- <xsl:template match="/list/directory"><tr>
- <td><a href="./{str:encode-uri(./text(), true(), 'UTF-8')}/"><xsl:value-of select="./text()"/>/</a></td>
- <td data-value="0" data-type="int">0 B</td>
- <td><xsl:value-of select="@mtime"/></td>
- </tr></xsl:template>
- <xsl:template match="/list/file"><tr>
- <td><a href="./{str:encode-uri(./text(), true(), 'UTF-8')}"><xsl:value-of select="./text()"/></a></td>
- <td data-type="int" data-value="{@size}"><xsl:number value="@size" grouping-separator=" " grouping-size="3"/> B</td>
- <td><xsl:value-of select="@mtime"/></td>
- </tr></xsl:template>
- </xsl:stylesheet>