File tree 3 files changed +14
-6
lines changed
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ export const docsConfig = Object.freeze({
23
23
i18nConfig,
24
24
defaultTitle : 'Aptos Docs' ,
25
25
defaultDescription : 'Docs for Aptos' ,
26
- githubUrl : 'https://github.com/aptos-labs/nextra ' ,
27
- githubDocsUrl : 'https://github.com/aptos-labs/nextra/ apps/aptos-swr-site ' ,
28
- githubNewIssueUrl : 'https://github.com/aptos-labs/nextra /issues/new' ,
26
+ githubUrl : 'https://github.com/aptos-labs/developer-docs ' ,
27
+ relativeDocsPath : '/ apps/nextra ' ,
28
+ githubNewIssueUrl : 'https://github.com/aptos-labs/developer-docs /issues/new' ,
29
29
googleAnalyticsId : 'G-LLF79THJN0' ,
30
30
origin : process . env . NEXT_PUBLIC_ORIGIN
31
31
} )
Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ export const docsConfig = Object.freeze({
67
67
i18nConfig,
68
68
defaultTitle: ' Aptos Docs' ,
69
69
defaultDescription: ' Docs for Aptos' ,
70
- githubUrl: ' https://github.com/aptos-labs/nextra ' ,
71
- githubDocsUrl : ' https://github.com/aptos-labs/nextra/ apps/aptos-swr-site ' ,
70
+ githubUrl: ' https://github.com/aptos-labs/developer-docs ' ,
71
+ relativeDocsPath : ' / apps/nextra ' ,
72
72
githubNewIssueUrl: ' https://github.com/aptos-labs/nextra/issues/new' ,
73
73
googleAnalyticsId: ' G-LLF79THJN0' ,
74
74
origin: process .env .NEXT_PUBLIC_ORIGIN
Original file line number Diff line number Diff line change @@ -24,13 +24,21 @@ function isFullUrl(url: string): boolean {
24
24
return pattern . test ( url ) ;
25
25
}
26
26
27
+ const url = new URL ( docsConfig . githubUrl ) ;
28
+ const pathname = url . pathname . endsWith ( '/' ) && url . pathname !== '/' ? url . pathname . slice ( 0 , - 1 ) : url . pathname ;
29
+ const githubUrl = `${ url . protocol } //${ url . host } ${ pathname } ${ url . search } ${ url . hash } ` ;
30
+
27
31
const config : DocsThemeConfig = {
28
32
darkMode : true ,
29
- docsRepositoryBase : docsConfig . githubDocsUrl ,
33
+ docsRepositoryBase : docsConfig . githubUrl ,
30
34
editLink : {
31
35
content : function useText ( ) {
32
36
const { locale } = useRouter ( )
33
37
return i18nConfig [ locale ! ] . editText
38
+ } ,
39
+ component : ( { children, className, filePath } ) => {
40
+ const href = `${ githubUrl } /edit/main${ docsConfig . relativeDocsPath } /${ filePath } ` ;
41
+ return < a className = { className } href = { href } > { children } </ a >
34
42
}
35
43
} ,
36
44
feedback : {
You can’t perform that action at this time.
0 commit comments