Unverified Commit 797dca59 authored by Reza Baharvand's avatar Reza Baharvand Committed by GitHub

fix: cover image redirect to undefined (#29311)



fixes #29310

## Bug

- [x] Related issues linked using `fixes #29310`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes
parent 0d4e4e90
......@@ -20,9 +20,13 @@ export default function CoverImage({ title, url, slug }) {
)
return (
<div className="sm:mx-0">
<Link href={`/posts/${slug}`}>
{slug ? <a aria-label={title}>{image}</a> : image}
</Link>
{slug ? (
<Link href={`/posts/${slug}`}>
<a aria-label={title}>{image}</a>
</Link>
) : (
image
)}
</div>
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment