Skip to content

Commit

Permalink
feat: add links to package definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Sep 29, 2023
1 parent afb215f commit 332bbad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
8 changes: 2 additions & 6 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ export default function App({ Component, pageProps }: AppProps) {
<Link href="/registry/list">Package list</Link>
</li>
<li>
<a target="_blank" href="https://github.com/williamboman/mason.nvim">
mason.nvim
</a>
<a href="https://github.com/williamboman/mason.nvim">mason.nvim</a>
</li>
<li>
<a target="_blank" href="https://github.com/mason-org/mason-registry">
mason-registry
</a>
<a href="https://github.com/mason-org/mason-registry">mason-registry</a>
</li>
</ul>
</nav>
Expand Down
23 changes: 15 additions & 8 deletions pages/registry/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export default function RegistryList({ packages, checksum, timestamp, version }:
} else {
return false
}
})
)
)
}),
),
),
)
}, [search, packages])

Expand Down Expand Up @@ -126,7 +126,16 @@ export default function RegistryList({ packages, checksum, timestamp, version }:
return (
<ListItem key={pkg.name}>
<h2 id={id}>
<a href={`#${id}`}>#</a> {pkg.name}
<a href={`#${id}`} aria-label="Anchor link to package">
#
</a>
<span>&nbsp;</span>
<a
href={`https://github.com/mason-org/mason-registry/blob/${version}/packages/${pkg.name}/package.yaml`}
aria-label="External link to package definition"
>
{pkg.name}
</a>
</h2>
<p>{pkg.description}</p>
<table className={styles.table}>
Expand All @@ -141,9 +150,7 @@ export default function RegistryList({ packages, checksum, timestamp, version }:
<tr>
<td>Homepage</td>
<td>
<a href={pkg.homepage} target="_blank">
{pkg.homepage}
</a>
<a href={pkg.homepage}>{pkg.homepage}</a>
</td>
</tr>

Expand Down Expand Up @@ -241,7 +248,7 @@ export const getStaticProps: GetStaticProps<Props> = async () => {
const version = latestRelease.tag_name

const registryZip = await fetch(
`https://github.com/mason-org/mason-registry/releases/download/${version}/registry.json.zip`
`https://github.com/mason-org/mason-registry/releases/download/${version}/registry.json.zip`,
)

const zip = new AdmZip(Buffer.from(await registryZip.arrayBuffer()))
Expand Down

0 comments on commit 332bbad

Please sign in to comment.