Skip to content

Commit

Permalink
[docs] Allow to host code in a different repo
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Nov 4, 2020
1 parent 81ee3c5 commit 865c1c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/src/modules/components/AppFrame.js
Expand Up @@ -29,7 +29,7 @@ import Link from 'docs/src/modules/components/Link';
import AppDrawer from 'docs/src/modules/components/AppDrawer';
import Notifications from 'docs/src/modules/components/Notifications';
import MarkdownLinks from 'docs/src/modules/components/MarkdownLinks';
import { LANGUAGES_LABEL } from 'docs/src/modules/constants';
import { LANGUAGES_LABEL, SOURCE_CODE_REPO } from 'docs/src/modules/constants';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
import RtlContext from 'docs/src/modules/utils/RtlContext';
import { useChangeTheme } from 'docs/src/modules/components/ThemeContext';
Expand Down Expand Up @@ -296,7 +296,7 @@ function AppFrame(props) {
<IconButton
component="a"
color="inherit"
href="https://github.com/mui-org/material-ui"
href={SOURCE_CODE_REPO}
data-ga-event-category="header"
data-ga-event-action="github"
>
Expand Down
6 changes: 5 additions & 1 deletion docs/src/modules/constants.js
Expand Up @@ -54,7 +54,10 @@ const LANGUAGES_LABEL = [
];

// #default-branch-switch
const SOURCE_CODE_ROOT_URL = 'https://github.com/mui-org/material-ui/blob/next';
const SOURCE_CODE_ROOT_URL =
process.env.SOURCE_CODE_ROOT_URL || 'https://github.com/mui-org/material-ui/blob/next';
const SOURCE_CODE_REPO =
process.env.SOURCE_CODE_REPO || 'https://github.com/mui-org/material-ui';

module.exports = {
CODE_VARIANTS,
Expand All @@ -64,4 +67,5 @@ module.exports = {
LANGUAGES_LABEL,
LANGUAGES_IN_PROGRESS,
SOURCE_CODE_ROOT_URL,
SOURCE_CODE_REPO,
};

0 comments on commit 865c1c8

Please sign in to comment.