Skip to content

Commit

Permalink
feat: add nofollow external links
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelgautier committed May 18, 2024
1 parent ae877b8 commit 538cea5
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contentlayer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
} from '@galactiks/contentlayer'
import { makeSource } from 'contentlayer/source-files';
import remarkGfm from 'remark-gfm';
import rehypeExternalLinks from 'rehype-external-links';
import rehypeSlug from 'rehype-slug';

const contentLayerConfig = makeSource({
contentDirPath: 'content',
Expand All @@ -24,7 +26,13 @@ const contentLayerConfig = makeSource({
WebpageElementDocumentType,
],
mdx: {
remarkPlugins: [remarkGfm],
remarkPlugins: [
remarkGfm,
],
rehypePlugins: [
rehypeSlug,
[rehypeExternalLinks, { rel: ['noopener', 'noreferrer', 'nofollow'] }],
],
},
disableImportAliasWarning: true,
})
Expand Down
100 changes: 100 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"dependencies": {
"@galactiks/contentlayer": "0.2.7",
"contentlayer": "0.3.4",
"rehype-external-links": "2.1.0",
"rehype-slug": "5.1.0",
"remark-gfm": "3.0.1"
},
"devDependencies": {
Expand Down

0 comments on commit 538cea5

Please sign in to comment.