Add meta tags for slack/discord preview

This commit is contained in:
kageru 2020-03-12 10:40:25 +01:00
parent cfffbdccd7
commit 8e5becc777
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
3 changed files with 11 additions and 1 deletions

View File

@ -11,6 +11,9 @@ object AboutPage {
val content = HtmlContent(HttpStatusCode.OK) {
head {
link(rel = "stylesheet", href = "/style.css", type = "text/css")
meta(content = "About Kodeshare – a FOSS [ph]astebin alternative") {
attributes["property"] = "og:title"
}
}
body {
div("wrapper") {

View File

@ -8,7 +8,7 @@ object Homepage {
val content = HtmlContent(HttpStatusCode.OK) {
head {
link(rel = "stylesheet", href = "/style.css", type = "text/css")
meta(content = "Kodeshare – a FOSS pastebin alternative") {
meta(content = "Kodeshare – a FOSS [ph]astebin alternative") {
attributes["property"] = "og:title"
}
}

View File

@ -13,6 +13,13 @@ object PastePage {
type = "text/css"
)
script(src = "https://p.kageru.moe/static/hl.js") {}
meta(content = "Kodeshare – a FOSS [ph]astebin alternative") {
attributes["property"] = "og:title"
}
// Show the first 3 lines in preview/embed for applications like discord, slack, or skype
meta(content = content.lines().take(3).joinToString("\n")) {
attributes["property"] = "og:description"
}
unsafe {
+"<script>hljs.initHighlightingOnLoad();</script>"
+"<style>html{scrollbar-color: transparent transparent;}::-webkit-scrollbar{display: none;}</style>"