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

404 on "edit this page" static site button #19168

Closed
florent-andre opened this issue Jan 10, 2020 · 7 comments · Fixed by #19170
Closed

404 on "edit this page" static site button #19168

florent-andre opened this issue Jan 10, 2020 · 7 comments · Fixed by #19170
Labels
docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process. priority: important This change can make a difference

Comments

@florent-andre
Copy link

  • sets to reproduce :
  • go on this page
  • click on "edit this page" button
  • 404 ! :)

There is a misconfiguration in the static generator path configuration :
Actual Button path :

https://github.com/mui-org/material-ui/blob/master/docs/src/docs/src/pages/components/cards/cards.md

Real path :

https://github.com/mui-org/material-ui/blob/master/docs/src/pages/components/cards/cards.md

Here is the double copy typo in the button path : docs/src/docs/src

Regards.

@oliviertassinari
Copy link
Member

@florent-andre Thank you for the feedback. I should have been more careful in a recent refactorization. What do you think of this fix? Do you want to submit a pull request? :)

diff --git a/docs/src/modules/components/useMarkdownDocs.js b/docs/src/modules/components/useMarkdownDocs.js
index 87d8210d6..5f50b206f 100644
--- a/docs/src/modules/components/useMarkdownDocs.js
+++ b/docs/src/modules/components/useMarkdownDocs.js
@@ -143,7 +143,7 @@ ${headers.components
               key={content}
               demo={demos[name]}
               demoOptions={demoOptions}
-              githubLocation={`${SOURCE_CODE_ROOT_URL}/${name}`}
+              githubLocation={`${SOURCE_CODE_ROOT_URL}/docs/src/${name}`}
             />
           );
         }
diff --git a/docs/src/modules/constants.js b/docs/src/modules/constants.js
index 855110bb2..ff0526878 100644
--- a/docs/src/modules/constants.js
+++ b/docs/src/modules/constants.js
@@ -52,7 +52,7 @@ const LANGUAGES_LABEL = [
   },
 ];

-const SOURCE_CODE_ROOT_URL = 'https://github.com/mui-org/material-ui/blob/master/docs/src';
+const SOURCE_CODE_ROOT_URL = 'https://github.com/mui-org/material-ui/blob/master';

 module.exports = {
   CODE_VARIANTS,
diff --git a/docs/src/modules/utils/generateMarkdown.js b/docs/src/modules/utils/generateMarkdown.js
index 39d9306c5..538a25cff 100644
--- a/docs/src/modules/utils/generateMarkdown.js
+++ b/docs/src/modules/utils/generateMarkdown.js
@@ -3,9 +3,8 @@ import * as recast from 'recast';
 import { parse as docgenParse } from 'react-docgen';
 import { Router as Router2 } from 'next/router';
 import { pageToTitle } from './helpers';
-import { LANGUAGES_IN_PROGRESS } from 'docs/src/modules/constants';
+import { SOURCE_CODE_ROOT_URL, LANGUAGES_IN_PROGRESS } from 'docs/src/modules/constants';

-const SOURCE_CODE_ROOT_URL = 'https://github.com/mui-org/material-ui/blob/master';
 const PATH_REPLACE_REGEX = /\\/g;
 const PATH_SEPARATOR = '/';
 const DEMO_IGNORE = LANGUAGES_IN_PROGRESS.map(language => `-${language}.md`);

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process. labels Jan 10, 2020
@mbrookes mbrookes added the priority: important This change can make a difference label Jan 10, 2020
@nelopuchades
Copy link
Contributor

hi! I take this issue! thanks 👍🏻

@nelopuchades
Copy link
Contributor

I have done this PR to fix the issue!

@nelopuchades
Copy link
Contributor

I'm quite new to open source and contributing, I'm sorry if something is wrong. I will be better with time.. haha

@nelopuchades
Copy link
Contributor

Thank you too Olivier! @oliviertassinari

@florent-andre
Copy link
Author

This should be re-opened as the static site was not deployed or the fix has missing part. There is still a 404 on the button.

@mbrookes
Copy link
Member

@florent-andre An issue is closed when the associated PR is committed. That's just how GitHub works (but also how issues are handled in general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process. priority: important This change can make a difference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants