Skip to content

Commit

Permalink
related: display author next to link if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ooloth committed Jan 5, 2025
1 parent 67fbb27 commit d615338
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Related.astro
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ const displayedIds = new Set()
<ul>
{tagEntries.map(entry => {
if (displayedIds.has(entry.id)) return null
const author = 'author' in entry.data ? entry.data.author : null
displayedIds.add(entry.id)

return (
<li>
<a href={`/${entry.id}/`} class="link-nav">
{entry.data.title}
</a>
{author ? (
<>
<span class="mx-1 text-[--moonlight-red]">•</span>
<span class="text-zinc-400">{author}</span>
</>
) : null}
<span class="ml-1" set:html={getIconHtml(entry)} />
</li>
)
Expand Down

0 comments on commit d615338

Please sign in to comment.