Material-ui: Markdown in Blog Layout Example dont work

Created on 3 Nov 2018  Â·  3Comments  Â·  Source: mui-org/material-ui

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

question

Most helpful comment

@Marcosul It seems create-react-app doesn't support the markdown format: https://github.com/facebook/create-react-app/issues/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.

All 3 comments

@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).

Hello Oliver, I'm not using the webpack. I used the react-create-app from
the repository of the mui wue does not have the webpack. how do I do?

Thanks

Em Dom, 4 de nov de 2018 09:31, Olivier Tassinari notifications@github.com
escreveu:

@Marcosul https://github.com/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
https://github.com/webpack-contrib/raw-loader to handle the markdown
extension (.md).

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mui-org/material-ui/issues/13501#issuecomment-435661845,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEfuIsetDNby_ZrJfYIS-kyA1aIa2nqIks5urs_4gaJpZM4YNAFA
.

@Marcosul It seems create-react-app doesn't support the markdown format: https://github.com/facebook/create-react-app/issues/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.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sys13 picture sys13  Â·  3Comments

chris-hinds picture chris-hinds  Â·  3Comments

ryanflorence picture ryanflorence  Â·  3Comments

ericraffin picture ericraffin  Â·  3Comments

rbozan picture rbozan  Â·  3Comments