Skip to content

Commit

Permalink
GH-2176 Adjust generated links for Ivy integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Aug 20, 2024
1 parent 564ff22 commit 325eb75
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal fun createDirectoryIndexPage(basePath: String, uri: String, authenticat
<head>
<title>Index of $formattedUri</title>
<meta charset='utf-8'>
<base href='${formattedUri.removeSuffix("/")}/'>
<style>
li {
padding: 2px 10px;
Expand All @@ -32,13 +33,15 @@ internal fun createDirectoryIndexPage(basePath: String, uri: String, authenticat
<h1>Index of $formattedUri</h1>
<ul>
<li class='back'>
<a href='${formattedUri.substringBeforeLast("/")}'>Parent Directory</a>
<a href='${formattedUri.removeSuffix("/").substringBeforeLast("/")}'>Parent Directory</a>
</li>
${authenticatedFiles.flatMap {
${authenticatedFiles.flatMap {
val fileSeparator = if (it.type == FileType.DIRECTORY) "/" else ""
listOf(
"<li class='${it.type.name.lowercase()}'>",
"<a href='$formattedUri/${it.name}'>${it.name}${if (it.type == FileType.DIRECTORY) "/" else ""}</a>",
"</li>"
"""<li class="${it.type.name.lowercase()}">""",
"""<a href="./${it.name}$fileSeparator">${it.name}$fileSeparator</a>""",
"""</li>"""
)
}.joinToString(separator = "")}
</ul>
Expand Down

0 comments on commit 325eb75

Please sign in to comment.