Update page-mastodon.php

This commit is contained in:
浪子 2024-06-05 09:26:55 +08:00
parent 5a880c019d
commit 6b8c0d0095
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ window.onload = function() {
function formatHTML(toots) {
let htmlString = '';
toots.forEach(toot => {
const { content, account, created_at, media_attachments} = toot;
const { content, account, url, created_at, media_attachments} = toot;
let mediaHTML = ''; // 初始化资源相关HTML为空字符串
// 处理媒体附件
if (media_attachments.length > 0) {
@ -46,7 +46,7 @@ window.onload = function() {
<div class='content'>
<header>
<img src="${account.avatar}" class="avatar" width="48" height="48" />
<a class="humane--time" href="${account.url}" target="_blank">${new Date(created_at).toLocaleString()}</a>
<a class="humane--time" href="${url}" target="_blank">${new Date(created_at).toLocaleString()}</a>
</header>
<div class="description" itemprop="about">
${htmlContent}