ktor-revfile-html
Tiny extensions for kotlinx.html, providing direct interop with the main ktor-revfile-core
library.
Usage
Currently, two functions are available: script
and stylesheet
.
call.respondHtml {
head {
// with this library
script(AppAssets.main)
stylesheet(AppAssets.styles)
// without this library
script(src = AppAssets.main.path) {}
link(href = AppAssets.styles.path, rel = "stylesheet")
}
}
Content copied to clipboard
Note that the content type won't be verified.
If you feel the need, you can enable out-of-the-box subresource integrity.
install(RevFilePlugin) {
useSubresourceIntegrity = true // false by default
}
Content copied to clipboard