mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-05-04 02:23:51 +01:00
feat(website): display authors on package page
This commit is contained in:
parent
4f02a8db2a
commit
ecd6841121
1 changed files with 28 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { BinaryIcon, Icon, LibraryIcon } from "lucide-svelte"
|
||||
import { BinaryIcon, Globe, Icon, LibraryIcon, Mail } from "lucide-svelte"
|
||||
import { page } from "$app/stores"
|
||||
import type { TargetInfo } from "$lib/registry-api"
|
||||
import type { ComponentType } from "svelte"
|
||||
|
@ -103,5 +103,32 @@
|
|||
</p>
|
||||
<Command command={xCommand} class="mb-6" />
|
||||
{/if}
|
||||
|
||||
{#if data.pkg.authors && data.pkg.authors.length > 0}
|
||||
<h2 class="mb-2 text-lg font-semibold text-heading">Authors</h2>
|
||||
<ul>
|
||||
{#each data.pkg.authors as author}
|
||||
{@const [, name] = author.match(/^(.*?)(<|\()/) ?? []}
|
||||
{@const [, email] = author.match(/<(.*)>/) ?? []}
|
||||
{@const [, website] = author.match(/\((.*)\)/) ?? []}
|
||||
|
||||
<li class="mb-2 flex items-center">
|
||||
{name}
|
||||
<div class="ml-auto flex items-center space-x-2">
|
||||
{#if email}
|
||||
<a href={`mailto:${email}`} class="ml-1 text-primary" title={`Email: ${email}`}>
|
||||
<Mail class="size-5 text-primary" aria-hidden="true" />
|
||||
</a>
|
||||
{/if}
|
||||
{#if website}
|
||||
<a href={website} class="ml-1 text-primary" title={`Website: ${website}`}>
|
||||
<Globe class="size-5 text-primary" aria-hidden="true" />
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
</aside>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue