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

Markdown in Blog Layout Example dont work #13501

Closed
Marcosul opened this issue Nov 3, 2018 · 5 comments
Closed

Markdown in Blog Layout Example dont work #13501

Marcosul opened this issue Nov 3, 2018 · 5 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@Marcosul
Copy link

Marcosul commented Nov 3, 2018

I've pasted the files from the blog example page but the .md files do not load on the screen.

See how it appears to me.

What am I doing wrong?

Does anyone know how to help me?

Thank you very much.
Marco

image

@oliviertassinari
Copy link
Member

@Marcosul Your bundler is having issues loading the content of the markdown, it stops at the filename:

https://github.com/mui-org/material-ui/blob/7e32503b40a57f42f906add50a2ace9341aa0895/docs/src/pages/page-layout-examples/blog/Blog.js#L17-L20

If you are using webpack, you can configure the raw-loader to handle the markdown extension (.md).

@oliviertassinari oliviertassinari added the support: question Community support but can be turned into an improvement label Nov 4, 2018
@Marcosul
Copy link
Author

Marcosul commented Nov 4, 2018 via email

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 4, 2018

@Marcosul It seems create-react-app doesn't support the markdown format: facebook/create-react-app#3722. I can think of two workarounds:

  • You can convert the markdown file into a JavaScript module that exports the markdown as a string.
--- a/blog-post.md
+++ b/blog-post.md.js
-## Sample blog post

-#### April 1, 2020 by Olivier

-This blog post shows a few different types of content that are supported and styled with
-Material styles. Basic typography, images, and code are all supported.
-You can extend these by modifying `Markdown.js`.
+export default `
+## Sample blog post

+#### April 1, 2020 by Olivier

+This blog post shows a few different types of content that are supported and styled with
+Material styles. Basic typography, images, and code are all supported.
+You can extend these by modifying `Markdown.js`.
+`;
  • You can eject and add this webpack loader.

@PandasPan

This comment has been minimized.

@mayuehit

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

4 participants