The Wayback Machine - https://web.archive.org/web/20201124045945/https://github.com/mui-org/material-ui/issues/23406
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] View the source on Github links not working in AppBar #23406

Open
dmatranga opened this issue Nov 5, 2020 · 8 comments
Open

[docs] View the source on Github links not working in AppBar #23406

dmatranga opened this issue Nov 5, 2020 · 8 comments

Comments

@dmatranga
Copy link

@dmatranga dmatranga commented Nov 5, 2020

'View the source on Github' links not working in AppBar Documentation

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When I click on a link from this page https://v3.material-ui.com/demos/app-bar/, I get a 404 message.

Expected Behavior 🤔

I expect to be led to a page where I can view the source for each of the AppBar samples on Github.

Steps to Reproduce 🕹

Steps:

  1. Visit the AppBar Documentation page
  2. Click the Github icon button above each sample, which reads 'View the source on Github' on hover.
  3. Receive 404 message.

Context 🔦

Trying to learn how to use React Material UI components to build a web application.

Your Environment 🌎

Tech Version
Material-UI v5.?.?
React
Browser
TypeScript
etc.
@eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 5, 2020

Thanks for the report.

We're currently not using permalinks for GitHub links so these are prone to grow stale on old deployed docs. We should rethink our "link to github" strategy in general. I think in this example we could use actual permalinks via commit SHA.

@eps1lon eps1lon added the bug 🐛 label Nov 5, 2020
@victorcbr

This comment was marked as off-topic.

@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 8, 2020

We had a discussion in the past about this problem. It was somewhat made on purpose, but I can't recall the motivation. These links are barely used:

Capture d’écran 2020-11-08 à 13 15 30

But it's always a move in the right direction. @dmatranga do you want to work on a pull request? :)

diff --git a/docs/src/modules/components/MarkdownDocs.js b/docs/src/modules/components/MarkdownDocs.js
index 7b925a63b2..ac24a91037 100644
--- a/docs/src/modules/components/MarkdownDocs.js
+++ b/docs/src/modules/components/MarkdownDocs.js
@@ -8,7 +8,7 @@ import Head from 'docs/src/modules/components/Head';
 import AppFrame from 'docs/src/modules/components/AppFrame';
 import EditPage from 'docs/src/modules/components/EditPage';
 import AppContainer from 'docs/src/modules/components/AppContainer';
-import { SOURCE_CODE_ROOT_URL } from 'docs/src/modules/constants';
+import { SOURCE_CODE_REPO } from 'docs/src/modules/constants';
 import Demo from 'docs/src/modules/components/Demo';
 import AppTableOfContents from 'docs/src/modules/components/AppTableOfContents';
 import MarkdownElement from 'docs/src/modules/components/MarkdownElement';
@@ -134,7 +134,7 @@ function MarkdownDocs(props) {
                   }}
                   disableAd={disableAd}
                   demoOptions={renderedMarkdownOrDemo}
-                  githubLocation={`${SOURCE_CODE_ROOT_URL}/docs/src/${name}`}
+                  githubLocation={`${SOURCE_CODE_REPO}/blob/v${process.env.LIB_VERSION}/docs/src/${name}`}
                 />
               );
             })}
@oliviertassinari oliviertassinari changed the title View the source on Github links not working in AppBar Documentation [docs] View the source on Github links not working in AppBar Nov 8, 2020
@Maxgit3
Copy link
Contributor

@Maxgit3 Maxgit3 commented Nov 8, 2020

Do you need assistance with this issue?

@nauman99
Copy link

@nauman99 nauman99 commented Nov 8, 2020

Can I take this ?

@ZeeshanTamboli
Copy link

@ZeeshanTamboli ZeeshanTamboli commented Nov 12, 2020

@nauman99 Are you already working on this? Don't want to duplicate your effort otherwise I'll take it up.

@nauman99
Copy link

@nauman99 nauman99 commented Nov 12, 2020

@ZeeshanTamboli I haven't started it yet. You can take it if you want.

@ZeeshanTamboli
Copy link

@ZeeshanTamboli ZeeshanTamboli commented Nov 12, 2020

@nauman99 Okay. I will be working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.