Update PostLayout to support parsing x.com usernames

This commit is contained in:
gnehs 2024-02-26 14:21:30 +08:00 committed by GitHub
parent abfa4b6940
commit d1e84b91d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,7 +81,7 @@ export default function PostLayout({ content, authorDetails, next, prev, childre
href={author.twitter}
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"
>
{author.twitter.replace('https://twitter.com/', '@')}
{author.twitter.replace('https://twitter.com/', '@').replace('https://x.com/', '@')}
</Link>
)}
</dd>