farmOS / farmOS.org

Repository for the official farmOS.org website.
https://farmOS.org
10 stars 6 forks source link

Install and configure gatsby-remark-copy-linked-files #81

Closed mstenta closed 1 year ago

mstenta commented 1 year ago

This adds the gatsby-remark-copy-linked-files plugin.

Copies local files linked to/from Markdown (.md|.markdown) files to the public folder.

This is necessary for non-image files, which are currently handled for us by the gatsby-remark-images plugin. Notably, the gatsby-remark-images mentions the gatsby-remark-copy-linked-files plugin is necessary for image types that it doesn't handle:

Since Sharp is used for image processing, this plugin will not support GIFs or SVGs. If you would like to render these file types with the image markdown syntax, use the gatsby-remark-copy-linked-files plugin. Do note with this it will load in the images, but won’t use the features of Sharp such as the elastic container or the blur-up enhancements.

The motivation for this PR is so that we can include MP4s in blog posts. I explored the various options and considerations for this in #75.

In the future, we may also want to add the gatsby-remark-videos plugin, which automatically handles/converts/resizes video files similar to the way that gatsby-remark-images works. The gatsby-remark-videos plugin also mentions the need for gatsby-remark-copy-linked-files in its docs:

Also make sure you have a plugin that copies the files you are referencing, for example gatsby-remark-copy-linked-files.

So it seems that this plugin (gatsby-remark-copy-linked-files) is the standard way to handle copying linked files.

I expect that this will work naturally with both our gatsby-source-filesystem plugin (which sources files from this repo), and our gatsby-source-git plugin (which sources files from remote repos like farmOS-community-blog).

netlify[bot] commented 1 year ago

Deploy Preview for gracious-brattain-bdd606 ready!

Name Link
Latest commit be7351b8691d3c476e9603c4fe84902ee656c26e
Latest deploy log https://app.netlify.com/sites/gracious-brattain-bdd606/deploys/6468b95d79c84500073c2558
Deploy Preview https://deploy-preview-81--gracious-brattain-bdd606.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.