feat: ogpに対応

This commit is contained in:
usbharu 2024-08-12 22:04:42 +09:00
parent f4d30e837e
commit be07a89b7f
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 14 additions and 1 deletions

View File

@ -1,8 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ja" xmlns:th="http://www.thymeleaf.org"> <html lang="ja" xmlns:th="http://www.thymeleaf.org">
<head> <head prefix="og: http://ogp.me/ns#">
<meta charset="UTF-8"> <meta charset="UTF-8">
<title th:text="#{post-by-id.title(${post.actor.screenName},${instance.name})}">Posts - hideout</title> <title th:text="#{post-by-id.title(${post.actor.screenName},${instance.name})}">Posts - hideout</title>
<meta property="og:url" th:content="${post.url}">
<meta property="og:title" th:content="#{post-by-id.title(${post.actor.screenName},${instance.name})}">
<meta property="og:description" th:content="${post.text}">
<th:block
th:if="${post.mediaDetailList.isEmpty() || (post.mediaDetailList.get(0).thumbnailUrl == null && (post.mediaDetailList.get(0).type != 'Image' || post.mediaDetailList.get(0).type != 'Video'))}">
<meta property="og:image" th:content="${post.actor.icon}">
</th:block>
<th:block
th:unless="${post.mediaDetailList.isEmpty() || (post.mediaDetailList.get(0).thumbnailUrl == null && (post.mediaDetailList.get(0).type != 'Image' || post.mediaDetailList.get(0).type != 'Video'))}">
<meta property="og:image" th:content="${post.mediaDetailList.get(0).thumbnailUrl}">
</th:block>
</head> </head>
<body> <body>
<noscript> <noscript>