astro-typed-links
v1.1.5
Published
An Astro integration to automatically get typed links to your pages.
Maintainers
Readme
astro-typed-links
This is an Astro integration that automatically get typed links to your pages.
Usage
Prerequisites
- Requires Astro
>=5.0.0
Installation
Install the integration automatically using the Astro CLI:
pnpm astro add astro-typed-linksnpx astro add astro-typed-linksyarn astro add astro-typed-linksOr install it manually:
- Install the required dependencies
pnpm add astro-typed-linksnpm install astro-typed-linksyarn add astro-typed-links- Add the integration to your astro config
+import typedLinks from "astro-typed-links";
export default defineConfig({
integrations: [
+ typedLinks(),
],
});link helper
Import link from astro-typed-links and that's it!
import { link } from 'astro-typed-links'
link('/')
link('/blog/[slug]', { params: { slug: 'foo' }})
link('/about', { searchParams: { foo: 'bar' }, hash: 'contact' })Contributing
This package is structured as a monorepo:
playgroundcontains code for testing the packagepackagecontains the actual package
Install dependencies using pnpm:
pnpm i --frozen-lockfileStart the playground and package watcher:
pnpm devYou can now edit files in package. Please note that making changes to those files may require restarting the playground dev server.
Licensing
MIT Licensed. Made with ❤️ by Florian Lefebvre.
