generated from rnentjes/kotlin-server-web-empty
Refactor placeholder constants into dedicated file
Moved REPO_NAME and related constants into Placeholders.kt to improve code organization and maintainability. The code now dynamically references these constants where needed, simplifying updates and ensuring consistency across modules. Updated relevant imports and references to accommodate these changes.
This commit is contained in:
@@ -8,6 +8,8 @@ import kotlinx.html.script
|
||||
import kotlinx.html.stream.appendHTML
|
||||
import kotlinx.html.title
|
||||
import nl.astraeus.tmpl.REPO_NAME
|
||||
import nl.astraeus.tmpl.pageTitle
|
||||
import nl.astraeus.tmpl.repoName
|
||||
|
||||
fun generateIndex(patch: String?): String {
|
||||
val result = StringBuilder();
|
||||
@@ -15,17 +17,17 @@ fun generateIndex(patch: String?): String {
|
||||
if (patch == null) {
|
||||
result.appendHTML(true).html {
|
||||
head {
|
||||
title("${REPO_NAME}")
|
||||
title(pageTitle)
|
||||
//link("/css/all.min.css", "stylesheet")
|
||||
}
|
||||
body {
|
||||
script(src = "/${REPO_NAME}.js") {}
|
||||
script(src = "/$repoName.js") {}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result.appendHTML(true).html {
|
||||
head {
|
||||
title("${REPO_NAME}")
|
||||
title(pageTitle)
|
||||
meta {
|
||||
httpEquiv = "refresh"
|
||||
content = "0; url=/$itemUrl/$patch"
|
||||
|
||||
Reference in New Issue
Block a user