44const lightCodeTheme = require ( "prism-react-renderer/themes/github" ) ;
55const darkCodeTheme = require ( "prism-react-renderer/themes/dracula" ) ;
66
7+ let githubOrganization = "mbta" ;
8+ let githubProject = "schemas" ;
9+ if ( process . env . GITHUB_REPOSITORY ) {
10+ [ githubOrganization , githubProject ] =
11+ process . env . GITHUB_REPOSITORY . split ( "/" ) ;
12+ }
13+
714/** @type {import('@docusaurus/types').Config } */
815const config = {
916 title : "MBTA Event Schemas" ,
@@ -17,9 +24,8 @@ const config = {
1724 baseUrl : process . env . GITHUB_BASE || "/" ,
1825
1926 // GitHub pages deployment config.
20- // If you aren't using GitHub pages, you don't need these.
21- organizationName : "mbta" , // Usually your GitHub org/user name.
22- projectName : "schemas" , // Usually your repo name.
27+ organizationName : githubOrganization ,
28+ projectName : githubProject , // Usually your repo name.
2329
2430 onBrokenLinks : "throw" ,
2531 onBrokenMarkdownLinks : "warn" ,
@@ -43,7 +49,7 @@ const config = {
4349 sidebarCollapsed : false ,
4450 // Please change this to your repo.
4551 // Remove this to remove the "edit this page" links.
46- editUrl : " https://github.com/mbta/schemas /tree/main/" ,
52+ editUrl : ` https://github.com/${ githubOrganization } / ${ githubProject } /tree/main/` ,
4753 } ,
4854 blog : false ,
4955 theme : {
@@ -74,7 +80,7 @@ const config = {
7480 label : "Events" ,
7581 } ,
7682 {
77- href : " https://github.com/mbta/schemas" ,
83+ href : ` https://github.com/${ githubOrganization } / ${ githubProject } ` ,
7884 label : "GitHub" ,
7985 position : "right" ,
8086 } ,
@@ -97,7 +103,7 @@ const config = {
97103 items : [
98104 {
99105 label : "GitHub" ,
100- href : " https://github.com/mbta/schemas" ,
106+ href : ` https://github.com/${ githubOrganization } / ${ githubProject } ` ,
101107 } ,
102108 ] ,
103109 } ,
0 commit comments