From cbcfa2dbc91ecc97fee0ea82bd5dc5d699f66e97 Mon Sep 17 00:00:00 2001 From: TheSaminator Date: Sun, 20 Feb 2022 18:02:40 -0500 Subject: [PATCH] Change the order of the tags?????????? AGAIN --- .../starshipfights/info/html_metadata.kt | 26 +------------------ .../kotlin/starshipfights/info/views_ships.kt | 3 +-- .../kotlin/starshipfights/info/views_user.kt | 12 ++------- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt b/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt index 2fe1780..f39be0b 100644 --- a/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt +++ b/src/jvmMain/kotlin/starshipfights/info/html_metadata.kt @@ -5,44 +5,20 @@ import kotlinx.html.HEAD data class PageMetadata( val title: String, val description: String, - val type: PageMetadataType, ) { 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!", - type = PageMetadataType.Website, ) } } -sealed class PageMetadataType { - object Website : PageMetadataType() - - data class Profile( - val name: String, - val isFemale: Boolean?, - ) : PageMetadataType() -} - fun HEAD.metadata(pageMetadata: PageMetadata, url: String) { metaOG("og:title", pageMetadata.title) metaOG("og:description", pageMetadata.description) metaOG("og:url", url) - - when (pageMetadata.type) { - is PageMetadataType.Profile -> { - metaOG("og:type", "profile") - metaOG("og:profile:username", pageMetadata.type.name) - pageMetadata.type.isFemale?.let { - metaOG("og:profile:gender", if (it) "female" else "male") - } - } - PageMetadataType.Website -> { - metaOG("og:type", "website") - } - } - + metaOG("og:type", "website") metaOG("og:site_name", "Starship Fights") metaOG("og:image", "https://starshipfights.net/static/images/embed-logo.png") } diff --git a/src/jvmMain/kotlin/starshipfights/info/views_ships.kt b/src/jvmMain/kotlin/starshipfights/info/views_ships.kt index 44c89fb..f7bc1cc 100644 --- a/src/jvmMain/kotlin/starshipfights/info/views_ships.kt +++ b/src/jvmMain/kotlin/starshipfights/info/views_ships.kt @@ -77,8 +77,7 @@ suspend fun ApplicationCall.shipPage(shipType: ShipType): HTML.() -> Unit = page ShipViewSidebar(shipType), PageMetadata( shipType.displayName + "-class Starship", - "A ${shipType.weightClass.displayName} of the ${shipType.faction.navyName}", - PageMetadataType.Website + "A ${shipType.weightClass.displayName} of the ${shipType.faction.navyName}" ) ) { section { diff --git a/src/jvmMain/kotlin/starshipfights/info/views_user.kt b/src/jvmMain/kotlin/starshipfights/info/views_user.kt index 57957c8..32963bc 100644 --- a/src/jvmMain/kotlin/starshipfights/info/views_user.kt +++ b/src/jvmMain/kotlin/starshipfights/info/views_user.kt @@ -101,11 +101,7 @@ suspend fun ApplicationCall.userPage(): HTML.() -> Unit { }, PageMetadata( user.profileName, - user.profileBio, - PageMetadataType.Profile( - user.profileName, - null - ) + user.profileBio ) ) { section { @@ -453,11 +449,7 @@ suspend fun ApplicationCall.admiralPage(): HTML.() -> Unit { ), PageMetadata( admiral.name, - "${admiral.rank.getDisplayName(admiral.faction)} of the ${admiral.faction.navyName}", - PageMetadataType.Profile( - admiral.name, - admiral.isFemale - ) + "${admiral.rank.getDisplayName(admiral.faction)} of the ${admiral.faction.navyName}" ) ) { section { -- 2.25.1