Skip to content

Commit

Permalink
docs: 📝 instruction for nextjs added in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashRajpurohit committed Apr 11, 2024
1 parent 6826557 commit 712c64e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-phones-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"remark-add-query-param": patch
---

docs: :memo: instruction for nextjs added in readme
2 changes: 1 addition & 1 deletion .changeset/small-flowers-bathe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"remark-add-query-param": patch
---

docs: :memo: readme updated with usage instructions
docs: :memo: instruction for Astro added in readme
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ export default defineConfig({
});
```

### Integration with Next.js

If you are using Next.js, you can use this plugin in your `next.config.js` file like this:

```javascript
import addQueryParam from 'remark-add-query-param';

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
};

const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [
[
addQueryParam,
{
queryParam: 'utm_source=remark-add-query-param',
externalLinks: true,
internalLinks: true,
},
],
],
},
});

export default withMDX(nextConfig);
```

## Configurations ⚙️

You can pass the following options to the plugin:
Expand Down

0 comments on commit 712c64e

Please sign in to comment.