Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 1.63 KB

README.md

File metadata and controls

90 lines (59 loc) · 1.63 KB

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-links
npx astro add astro-typed-links
yarn astro add astro-typed-links

Or install it manually:

  1. Install the required dependencies
pnpm add astro-typed-links
npm install astro-typed-links
yarn add astro-typed-links
  1. 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:

  • playground contains code for testing the package
  • package contains the actual package

Install dependencies using pnpm:

pnpm i --frozen-lockfile

Start the playground and package watcher:

pnpm dev

You 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.