Give up
authorTheSaminator <TheSaminator@users.noreply.github.com>
Sun, 20 Feb 2022 23:09:38 +0000 (18:09 -0500)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Sun, 20 Feb 2022 23:09:38 +0000 (18:09 -0500)
src/jvmMain/kotlin/starshipfights/auth/providers.kt
src/jvmMain/kotlin/starshipfights/info/html_metadata.kt [deleted file]
src/jvmMain/kotlin/starshipfights/info/view_tpl.kt
src/jvmMain/kotlin/starshipfights/info/views_ships.kt
src/jvmMain/kotlin/starshipfights/info/views_user.kt

index d3d9221ac354dc50db315d9379143a19c9221dd1..86c74f01315982f95c15fedb094c0799727fed53 100644 (file)
@@ -438,7 +438,7 @@ object TestAuthProvider : AuthProvider {
                                
                                val errorMsg = call.request.queryParameters["error"]
                                
-                               call.respondHtml(HttpStatusCode.OK, call.page("Authentication Test", call.standardNavBar(), CustomSidebar {
+                               call.respondHtml(HttpStatusCode.OK, page("Authentication Test", call.standardNavBar(), CustomSidebar {
                                        p {
                                                +"This instance does not have Discord OAuth login set up. As a fallback, this authentication mode is used for testing only."
                                        }
@@ -516,7 +516,7 @@ class ProductionAuthProvider(private val discordLogin: DiscordLogin) : AuthProvi
                        get("/login") {
                                val errorMsg = call.request.queryParameters["error"]
                                
-                               call.respondHtml(HttpStatusCode.OK, call.page("Login with Discord", call.standardNavBar()) {
+                               call.respondHtml(HttpStatusCode.OK, page("Login with Discord", call.standardNavBar()) {
                                        section {
                                                p {
                                                        style = "text-align:center"
diff --git a/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt b/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt
deleted file mode 100644 (file)
index bb41fbc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package starshipfights.info
-
-import kotlinx.html.HEAD
-
-data class PageMetadata(
-       val title: String,
-       val description: String,
-) {
-       companion object {
-               val default = PageMetadata(
-                       title = "Starship Fights",
-                       description = "Starship Fights is a space fleet battle game. Choose your allegiance, create your admiral, build up your fleet, and destroy your enemies' fleets with it!",
-               )
-       }
-}
-
-fun HEAD.metadata(pageMetadata: PageMetadata, url: String) {
-       metaOG("og:title", pageMetadata.title)
-       metaOG("og:description", pageMetadata.description)
-       metaOG("og:image", "https://starshipfights.net/static/images/embed-logo.png")
-       metaOG("og:type", "website")
-       metaOG("og:site_name", "Starship Fights")
-       metaOG("og:url", url)
-}
index 5ca4a7148d5b7bdb958dad76fe7bb8d4159ef7e2..2d098da9514978ce2b25815be4322b7cc9d5d3bf 100644 (file)
@@ -1,20 +1,11 @@
 package starshipfights.info
 
-import io.ktor.application.*
-import io.ktor.http.*
-import io.ktor.util.*
 import kotlinx.html.*
 
-fun ApplicationCall.page(pageTitle: String? = null, navBar: List<NavItem>? = null, sidebar: Sidebar? = null, pageData: PageMetadata = PageMetadata.default, content: MAIN.() -> Unit): HTML.() -> Unit = {
+fun page(pageTitle: String? = null, navBar: List<NavItem>? = null, sidebar: Sidebar? = null, content: MAIN.() -> Unit): HTML.() -> Unit = {
        head {
                meta(charset = "utf-8")
                
-               metadata(pageData, url {
-                       host = "starshipfights.net"
-                       protocol = URLProtocol.HTTPS
-                       port = 443
-               })
-               
                link(rel = "icon", type = "image/svg+xml", href = "/static/images/icon.svg")
                link(rel = "preconnect", href = "https://fonts.googleapis.com")
                link(rel = "preconnect", href = "https://fonts.gstatic.com") { attributes["crossorigin"] = "anonymous" }
index f7bc1cc98a2111c5561fcd780dd473204a30b954..636cc9fa98e9225d9d9402670be4ce8354e65176 100644 (file)
@@ -74,11 +74,7 @@ suspend fun ApplicationCall.shipsPage(): HTML.() -> Unit = page("Game Manual", s
 suspend fun ApplicationCall.shipPage(shipType: ShipType): HTML.() -> Unit = page(
        shipType.fullerDisplayName,
        standardNavBar(),
-       ShipViewSidebar(shipType),
-       PageMetadata(
-               shipType.displayName + "-class Starship",
-               "A ${shipType.weightClass.displayName} of the ${shipType.faction.navyName}"
-       )
+       ShipViewSidebar(shipType)
 ) {
        section {
                h1 { +shipType.fullDisplayName }
index 32963bc16bb35589a8d96f7983ea6d67c6e6dca0..b337c4af8f15b65628776264b80207a4412af1c4 100644 (file)
@@ -98,11 +98,7 @@ suspend fun ApplicationCall.userPage(): HTML.() -> Unit {
                                        }
                                }
                        }*/
-               },
-               PageMetadata(
-                       user.profileName,
-                       user.profileBio
-               )
+               }
        ) {
                section {
                        h1 { +user.profileName }
@@ -446,10 +442,6 @@ suspend fun ApplicationCall.admiralPage(): HTML.() -> Unit {
                                        NavLink("/admiral/${admiral.id}/manage", "Manage Admiral")
                                )
                        else emptyList()
-               ),
-               PageMetadata(
-                       admiral.name,
-                       "${admiral.rank.getDisplayName(admiral.faction)} of the ${admiral.faction.navyName}"
                )
        ) {
                section {