gibatronic/ngx-superbindex

No move up link

Closed this issue · 3 comments

The xml outputs the content in a way:

<list>
<directory mtime="2021-04-21T01:56:38Z">teamcity</directory>
<file mtime="2021-04-02T09:06:35Z" size="2">test.txt</file>
</list>

i.e. without link to parent folder.

In some way it need to be added...

Hi there!
Indeed the ngx_http_autoindex_module is quite limited, the XML you saw is all that it provides.

Adding something like:

                <a>
                        <xsl:attribute name="class">
                                <xsl:text>parent-link</xsl:text>
                        </xsl:attribute>

                        <xsl:attribute name="href">
                                <xsl:text>..</xsl:text>
                        </xsl:attribute>

                        <xsl:text>..</xsl:text>
                </a>

Seems to work just fine for me when added to the xslt before the ordered list. Though I have just discovered this project, and only played around with it a little. If there are subtle bugs I might not have discovered them yet. But I can move up one directory without any immediate problems with this.

So for just linking up one level this works. But if your intention is to get the name of the folder, I guess we are out of luck.

If there are subtle bugs I might not have discovered them yet. But I can move up one directory without any immediate problems with this.

The only quirk that I can tell would be that if autoindex is enabled on a root directory, we cannot determine if visitor is currently at said root directory, to then hide the .. link

Also if you match the HTML structures exactly to directory styling, it ends up looking pretty clean (live example on mine https://magane.fiery.me/), and can be matched by the type-to-search feature (though I just noticed it appears to be RegEx search)


I ended up just forking the project to add some JS magic to hide the .. link if on root path