Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
symlink the readme (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed May 15, 2022
1 parent 05e8ce5 commit d81f4ff
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lovely-kiwis-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"next-static-paths": patch
---

add a readme to the npm package
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Statically prevent HTTP 404 Not Found in your Next.js applications using TypeScr

🔗 A `<TypedLink />` component which wraps Next.js `<Link />` and provides type-safe path matching

📝 A `urlFor` helper that enables path generation in a type-safe manner
📝 A `pathFor` helper that enables path generation in a type-safe manner

## Usage

Expand Down
49 changes: 49 additions & 0 deletions packages/next-static-paths/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# `next-static-paths`

Statically prevent HTTP 404 Not Found in your Next.js applications using TypeScript and code generation.

## Usage

```sh-session
$ pnpm add next-static-paths
# or
$ yarn add next-static-paths
# or
$ npm install next-static-paths
```

Then, from within your Next.js application root, run the following command:

```sh-session
# For pnpm users
$ pnpx next-static-paths

# For yarn users
$ yarn next-static-paths

# For npm users
$ npx next-static-paths
```

### `TypedLink` component

```tsx
import { TypedLink } from "next-static-paths";
function MyComponent() {
return (
<TypedLink as="/some/[myArgument]" myArgument="hello world">
<a>Hello world</a>
</TypedLink>
);
}
```

### `pathFor` helper

```tsx
import { pathFor } from "next-static-paths";

function getPath() {
return pathFor("/some/[myArgument]", { myArgument: "hello world" });
}
```

0 comments on commit d81f4ff

Please sign in to comment.