From 4cf325faf770db6bde400c4952f63c65194f4477 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 26 Jun 2024 14:01:51 +0100 Subject: [PATCH] fix: Please work :c --- backend/src/main/kotlin/api/ProjectSetup.kt | 1 - .../src/main/kotlin/website/pages/Common.kt | 1 - .../kotlin/website/pages/docs/DocsPage.kt | 28 ++++++------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/backend/src/main/kotlin/api/ProjectSetup.kt b/backend/src/main/kotlin/api/ProjectSetup.kt index eded0ba..4b1f160 100644 --- a/backend/src/main/kotlin/api/ProjectSetup.kt +++ b/backend/src/main/kotlin/api/ProjectSetup.kt @@ -28,7 +28,6 @@ public fun setupRepository(projects: File) { } val coreDir = DATA_FOLDER.resolve("core").also(File::mkdirs) - println(coreDir.absolutePath) // Copy files tempFolder.listFiles()?.filter(File::isDirectory)?.forEach { it.copyRecursively(coreDir.resolve(it.name), overwrite = true) diff --git a/backend/src/main/kotlin/website/pages/Common.kt b/backend/src/main/kotlin/website/pages/Common.kt index 584477d..731d346 100644 --- a/backend/src/main/kotlin/website/pages/Common.kt +++ b/backend/src/main/kotlin/website/pages/Common.kt @@ -1,6 +1,5 @@ package dev.triumphteam.backend.website.pages -import dev.triumphteam.backend.api.database.ProjectEntity import kotlinx.html.FlowContent import kotlinx.html.HEAD import kotlinx.html.HTML diff --git a/backend/src/main/kotlin/website/pages/docs/DocsPage.kt b/backend/src/main/kotlin/website/pages/docs/DocsPage.kt index f02839f..005214a 100644 --- a/backend/src/main/kotlin/website/pages/docs/DocsPage.kt +++ b/backend/src/main/kotlin/website/pages/docs/DocsPage.kt @@ -103,6 +103,8 @@ private fun HTML.renderFullPage( styleLink("/static/css/themes/one_dark.css") val title = "TrimphTeam | ${project.name} - ${currentPage.title}" + // TODO: Replace with final URL, sucks that it can't be relative + val image = "https://new.triumphteam.dev/assets/${project.id}/${version.reference}/${currentPage.id}/banner.png" meta { name = "description" @@ -111,38 +113,28 @@ private fun HTML.renderFullPage( // Facebook Meta Tags meta { - unsafe { - raw("property = \"og:type\"") - } + attributes["property"] = "og:type" content = "article" } meta { - unsafe { - raw("property = \"og:title\"") - } + attributes["property"] = "og:title" content = title } meta { - unsafe { - raw("property = \"og:description\"") - } + attributes["property"] = "og:description" content = currentPage.subTitle } meta { - name = "og:title" + attributes["property"] = "og:title" content = title } meta { - unsafe { - raw("property = \"og:image\"") - } - // TODO: Replace with final URL, sucks that it can't be relative - content = - "https://new.triumphteam.dev/assets/${project.id}/${version.reference}/${currentPage.id}/banner.png" + attributes["property"] = "og:image" + content = image } // Twitter Meta Tags @@ -163,9 +155,7 @@ private fun HTML.renderFullPage( meta { name = "twitter:image" - // TODO: Replace with final URL, sucks that it can't be relative - content = - "https://new.triumphteam.dev/assets/${project.id}/${version.reference}/${currentPage.id}/banner.png" + content = image } title { +title }