diff --git a/komga/build.gradle.kts b/komga/build.gradle.kts index c5e15cdf..bc69bd11 100644 --- a/komga/build.gradle.kts +++ b/komga/build.gradle.kts @@ -143,6 +143,7 @@ kotlin { } val webui = "$rootDir/komga-webui" +val nextui = "$rootDir/next-ui" tasks { withType { sourceCompatibility = "17" @@ -218,6 +219,18 @@ tasks { } } + // modifies index.html to inject ThymeLeaf th: tags + register("prepareThymeLeafNext") { + group = "web" + from("$nextui/dist/index.html") + into("$projectDir/src/main/resources/public/") + filter { line -> + line.replace("((?:src|content|href)=\")([\\w]*/.*?)(\")".toRegex()) { + it.groups[0]?.value + " th:" + it.groups[1]?.value + "@{" + it.groups[2]?.value?.prefixIfNot("/") + "}" + it.groups[3]?.value + } + } + } + withType { filesMatching("application*.yml") { expand(project.properties) diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt index 5bda6d13..d09aad8c 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/web/WebMvcConfiguration.kt @@ -39,7 +39,7 @@ class WebMvcConfiguration : WebMvcConfigurer { ).addResourceLocations("classpath:public/") .setCacheControl(CacheControl.noStore()) - listOf("css", "fonts", "img", "js") + listOf("css", "fonts", "img", "js", "assets") .forEach { registry .addResourceHandler("/$it/**")