Seo
This commit is contained in:
parent
39fe7a5ab6
commit
bad5322abd
@ -7,7 +7,10 @@ import kotlinx.html.div
|
|||||||
import org.intellij.lang.annotations.Language
|
import org.intellij.lang.annotations.Language
|
||||||
|
|
||||||
class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver) {
|
class BaseView(staticFileResolver: StaticFileResolver) : View(staticFileResolver) {
|
||||||
fun renderHome(jwtPayload: JwtPayload?) = renderPage(title = "Home", jwtPayload = jwtPayload) {
|
fun renderHome(jwtPayload: JwtPayload?) = renderPage(
|
||||||
|
title = "Home",
|
||||||
|
description = "A fast and simple note taking website",
|
||||||
|
jwtPayload = jwtPayload) {
|
||||||
section("text-center my-2 p-2") {
|
section("text-center my-2 p-2") {
|
||||||
h1("text-5xl") {
|
h1("text-5xl") {
|
||||||
span("text-teal-300") { +"Simplenotes " }
|
span("text-teal-300") { +"Simplenotes " }
|
||||||
|
|||||||
@ -17,7 +17,6 @@ class NoteView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
|
|||||||
validationErrors: List<ValidationError> = emptyList(),
|
validationErrors: List<ValidationError> = emptyList(),
|
||||||
) = renderPage(title = "New note", jwtPayload = jwtPayload) {
|
) = renderPage(title = "New note", jwtPayload = jwtPayload) {
|
||||||
div("container mx-auto p-4") {
|
div("container mx-auto p-4") {
|
||||||
// TODO: error
|
|
||||||
error?.let { alert(Alert.Warning, error) }
|
error?.let { alert(Alert.Warning, error) }
|
||||||
validationErrors.forEach {
|
validationErrors.forEach {
|
||||||
alert(Alert.Warning, it.dataPath.substringAfter('.') + ": " + it.message)
|
alert(Alert.Warning, it.dataPath.substringAfter('.') + ": " + it.message)
|
||||||
|
|||||||
@ -15,7 +15,13 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
|
|||||||
jwtPayload: JwtPayload?,
|
jwtPayload: JwtPayload?,
|
||||||
error: String? = null,
|
error: String? = null,
|
||||||
validationErrors: List<ValidationError> = emptyList(),
|
validationErrors: List<ValidationError> = emptyList(),
|
||||||
) = accountForm("Register", jwtPayload, error, validationErrors, "Create an account", "Register") {
|
) = accountForm("Register",
|
||||||
|
"Registration page",
|
||||||
|
jwtPayload,
|
||||||
|
error,
|
||||||
|
validationErrors,
|
||||||
|
"Create an account",
|
||||||
|
"Register") {
|
||||||
+"Already have an account? "
|
+"Already have an account? "
|
||||||
a(href = "/login", classes = "no-underline text-blue-500 font-bold") { +"Sign In" }
|
a(href = "/login", classes = "no-underline text-blue-500 font-bold") { +"Sign In" }
|
||||||
}
|
}
|
||||||
@ -25,13 +31,14 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
|
|||||||
error: String? = null,
|
error: String? = null,
|
||||||
validationErrors: List<ValidationError> = emptyList(),
|
validationErrors: List<ValidationError> = emptyList(),
|
||||||
new: Boolean = false,
|
new: Boolean = false,
|
||||||
) = accountForm("Login", jwtPayload, error, validationErrors, "Sign In", "Sign In", new) {
|
) = accountForm("Login", "Login page", jwtPayload, error, validationErrors, "Sign In", "Sign In", new) {
|
||||||
+"Don't have an account yet? "
|
+"Don't have an account yet? "
|
||||||
a(href = "/register", classes = "no-underline text-blue-500 font-bold") { +"Create an account" }
|
a(href = "/register", classes = "no-underline text-blue-500 font-bold") { +"Create an account" }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun accountForm(
|
private fun accountForm(
|
||||||
title: String,
|
title: String,
|
||||||
|
description: String,
|
||||||
jwtPayload: JwtPayload?,
|
jwtPayload: JwtPayload?,
|
||||||
error: String? = null,
|
error: String? = null,
|
||||||
validationErrors: List<ValidationError> = emptyList(),
|
validationErrors: List<ValidationError> = emptyList(),
|
||||||
@ -39,7 +46,7 @@ class UserView(staticFileResolver: StaticFileResolver) : View(staticFileResolver
|
|||||||
submit: String,
|
submit: String,
|
||||||
new: Boolean = false,
|
new: Boolean = false,
|
||||||
footer: FlowContent.() -> Unit,
|
footer: FlowContent.() -> Unit,
|
||||||
) = renderPage(title = title, jwtPayload = jwtPayload) {
|
) = renderPage(title = title, description, jwtPayload = jwtPayload) {
|
||||||
div("centered container mx-auto flex justify-center items-center") {
|
div("centered container mx-auto flex justify-center items-center") {
|
||||||
div("w-full md:w-1/2 lg:w-1/3 m-4") {
|
div("w-full md:w-1/2 lg:w-1/3 m-4") {
|
||||||
h1("font-semibold text-lg mb-6 text-center") { +h1 }
|
h1("font-semibold text-lg mb-6 text-center") { +h1 }
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
|
Allow: /$
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user