File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { translate } from '@edgeandnode/gds'
4
4
5
5
// Compile `i18n.ts` to `i18n.js` since we can't import `ts` files in `next.config.js`
6
6
import { translations } from './dist/i18n.js'
7
- import { remarkReplaceGitHubLinks } from './src/remarkReplaceGitHubLinks .js'
7
+ import { remarkTransformRemoteGitHub } from './src/remarkTransformRemoteGitHub .js'
8
8
9
9
const env = {
10
10
ENVIRONMENT : process . env . ENVIRONMENT ,
@@ -99,7 +99,7 @@ const withNextra = nextra({
99
99
]
100
100
} ,
101
101
mdxOptions : {
102
- remarkPlugins : [ remarkReplaceGitHubLinks ] ,
102
+ remarkPlugins : [ remarkTransformRemoteGitHub ] ,
103
103
} ,
104
104
} )
105
105
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const GO_BACK_REPEATED_REGEX = /(\.\.\/)+/
23
23
24
24
const EXTERNAL_LINK_REGEX = / ^ ( h t t p s ? : ) ? \/ \/ /
25
25
26
- export const remarkReplaceGitHubLinks = ( ) => ( tree , file ) => {
26
+ export const remarkTransformRemoteGitHub = ( ) => ( tree , file ) => {
27
27
// Rewrite relative links to ensure they work
28
28
const filePath = path . relative ( process . cwd ( ) , file . history [ 0 ] )
29
29
const [ fileName , directory ] = filePath . split ( '/' ) . reverse ( )
@@ -62,6 +62,6 @@ remoteFilePath: https://github.com/${user}/${repo}/tree/${branch}/${docsPath}${f
62
62
delete node . children
63
63
delete node . position
64
64
65
- return EXIT // stop traversing in case there is other h1 nodes
65
+ return EXIT // stop traversing in case there are other h1 nodes
66
66
} )
67
67
}
You can’t perform that action at this time.
0 commit comments