Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Allow to host code in a different repo #23390

Merged
merged 1 commit into from Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
5 changes: 4 additions & 1 deletion docs/src/modules/constants.js
Expand Up @@ -54,7 +54,9 @@ 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 +66,5 @@ module.exports = {
LANGUAGES_LABEL,
LANGUAGES_IN_PROGRESS,
SOURCE_CODE_ROOT_URL,
SOURCE_CODE_REPO,
};