feat: OGP用のクラスを追加

This commit is contained in:
usbharu 2024-09-05 14:15:45 +09:00
parent df6d2940ed
commit 48d325deed
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
2 changed files with 14 additions and 6 deletions

View File

@ -0,0 +1,8 @@
package dev.usbharu.hideout.core.interfaces.web.common
data class OGP(
val title: String,
val url: String,
val description: String,
val image: String?
)

View File

@ -2,12 +2,12 @@
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head prefix="og: http://ogp.me/ns#">
<meta charset="UTF-8">
<title th:title="${title}">Index</title>
<meta property="og:url" th:content="${url}">
<meta property="og:title" th:content="${title}">
<meta property="og:description" th:content="${description}">
<th:block th:if="${image != null}">
<meta property="og:image" th:content="${image}">
<title th:title="${ogp.title}">Index</title>
<meta property="og:url" th:content="${ogp.url}">
<meta property="og:title" th:content="${ogp.title}">
<meta property="og:description" th:content="${ogp.description}">
<th:block th:if="${ogp.image != null}">
<meta property="og:image" th:content="${ogp.image}">
</th:block>
<noscript>
<meta http-equiv="refresh" th:content="${'1; url='+nsUrl}">