Skip to content

Commit dce5051

Browse files
committed
docs: sort versions correctly and add static latest link
1 parent 0280dc5 commit dce5051

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Create symlink to latest version
2828
run: |
2929
cd build/dokka
30-
latestVersion=$(for n in *; do printf '%s\n' "$n"; done | sort | grep -E "^[0-9]+\.[0-9]+" | tail -n1)
30+
latestVersion=$(for n in *; do printf '%s\n' "$n"; done | sort -V | grep -E "^[0-9]+\.[0-9]+" | tail -n1)
3131
if [[ -z "${latestVersion}" ]]; then
3232
ln -sf ${latestVersion} latest
3333
fi

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ fun createDocsIndexPage(): String {
324324
?.filter { it.isDirectory && !it.name.startsWith('.') }
325325
?.sortedByDescending { Version.parse(it.name) }
326326
if (versionDirs != null) {
327+
div("table-row") {
328+
div("main-subrow") {
329+
div("w-100") {
330+
span("inline-flex") {
331+
a(href = versionDirs.last().relativeTo(docsDir).parent.plus("/latest")) {
332+
+"modelix.core LATEST"
333+
}
334+
}
335+
}
336+
}
337+
}
327338
for (versionDir in versionDirs) {
328339
val versionIndex = versionDir.resolve("index.html")
329340
if (versionIndex.exists()) {

0 commit comments

Comments
 (0)