Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Example blog doesn't support local resources #1254

Open
jcayzac opened this issue Jun 30, 2018 · 3 comments
Open

Example blog doesn't support local resources #1254

jcayzac opened this issue Jun 30, 2018 · 3 comments

Comments

@jcayzac
Copy link

jcayzac commented Jun 30, 2018

If adding the following content to examples/react-app-blog/content/posts:

sixth-post/
  pic.png
  index.md # article content that references ![](./pic.png)
  1. The "latest posts" page lists both the article and a sixth-post/pic.png post.
    • I solved this by removing the phenomic entry in package.json and creating a phenomic.config.js file with:
      module.exports = {
        content: {
          content: {
            root: "content",
            globs: ["**/*.md"]
          },
        },
        presets: ["@phenomic/preset-react-app"],
      }
  2. The image is not copied anywhere.
  3. The image in the post is broken.

I feel like I'm missing something akin to gatsby-remark-copy-images and gatsby-remark-copy-linked-files, but not sure exactly what…

@MoOx
Copy link
Owner

MoOx commented Jun 30, 2018

This need to be improved indeed. Nothing is made to copy this files. Multiple solutions could be done. We should think about the easy one that does not cause performance trouble (eg does not check path in markdown ast as it will be expensive but instead just copy some given files)

@jcayzac
Copy link
Author

jcayzac commented Jul 1, 2018

does not check path in markdown ast as it will be expensive

But shouldn't those resources be in the page's bundle? 🤔

@MoOx
Copy link
Owner

MoOx commented Jul 27, 2018

That can make things heavy if each md files as tons of images... we should offers this as an option as it s ok for small site but this won’t scale for big project...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants