Merge pull request #49 from DoctorDerek/fix-error-if-twitter-undefined-in-siteMetadata
fix: make siteMetadata.twitter optional to fix TypeError
This commit is contained in:
commit
159ecd7d2b
@ -51,15 +51,19 @@ export default function PostLayout({ children, frontMatter, next, prev }) {
|
||||
<dl className="text-sm font-medium leading-5 whitespace-nowrap">
|
||||
<dt className="sr-only">Name</dt>
|
||||
<dd className="text-gray-900 dark:text-gray-100">{siteMetadata.author}</dd>
|
||||
<dt className="sr-only">Twitter</dt>
|
||||
<dd>
|
||||
<Link
|
||||
href={siteMetadata.twitter}
|
||||
className="text-blue-500 hover:text-blue-600 dark:hover:text-blue-400"
|
||||
>
|
||||
{siteMetadata.twitter.replace('https://twitter.com/', '@')}
|
||||
</Link>
|
||||
</dd>
|
||||
{typeof siteMetadata.twitter === 'string' && (
|
||||
<>
|
||||
<dt className="sr-only">Twitter</dt>
|
||||
<dd>
|
||||
<Link
|
||||
href={siteMetadata.twitter}
|
||||
className="text-blue-500 hover:text-blue-600 dark:hover:text-blue-400"
|
||||
>
|
||||
{siteMetadata.twitter.replace('https://twitter.com/', '@')}
|
||||
</Link>
|
||||
</dd>
|
||||
</>
|
||||
)}
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user