Add highlight js
This commit is contained in:
@@ -118,7 +118,11 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
|
||||
}
|
||||
}
|
||||
|
||||
fun renderedNote(jwtPayload: JwtPayload, note: PersistedNote) = renderPage(note.meta.title, jwtPayload = jwtPayload) {
|
||||
fun renderedNote(jwtPayload: JwtPayload, note: PersistedNote) = renderPage(
|
||||
note.meta.title,
|
||||
jwtPayload = jwtPayload,
|
||||
scripts = listOf("/highlight.10.1.2.js","/init-highlight.0.0.1.js")
|
||||
) {
|
||||
div("container mx-auto p-4") {
|
||||
div("flex items-center justify-between mb-4") {
|
||||
h1("text-3xl fond-bold underline") { +note.meta.title }
|
||||
|
||||
@@ -14,6 +14,7 @@ abstract class View(private val staticFileResolver: StaticFileResolver) {
|
||||
title: String,
|
||||
description: String? = null,
|
||||
jwtPayload: JwtPayload?,
|
||||
scripts: List<String> = emptyList(),
|
||||
body: MAIN.() -> Unit = {},
|
||||
) = buildString {
|
||||
appendLine("<!DOCTYPE html>")
|
||||
@@ -26,6 +27,9 @@ abstract class View(private val staticFileResolver: StaticFileResolver) {
|
||||
description?.let { meta(name = "description", content = it) }
|
||||
link(rel = "stylesheet", href = styles)
|
||||
link(rel = "shortcut icon", href = "/favicon.ico", type = "image/x-icon")
|
||||
scripts.forEach { src ->
|
||||
script(src = src) {}
|
||||
}
|
||||
}
|
||||
body("bg-gray-900 text-white") {
|
||||
navbar(jwtPayload)
|
||||
|
||||
Reference in New Issue
Block a user