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

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

Merged
merged 1 commit into from
May 22, 2023

Conversation

mstenta
Copy link
Member

@mstenta mstenta commented May 20, 2023

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
Copy link

netlify bot commented May 20, 2023

Deploy Preview for gracious-brattain-bdd606 ready!

Name Link
🔨 Latest commit be7351b
🔍 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.

@mstenta mstenta force-pushed the gatsby-remark-copy-linked-files branch from a9ea18d to be7351b Compare May 20, 2023 12:13
@mstenta mstenta marked this pull request as ready for review May 20, 2023 12:13
@mstenta mstenta changed the title Install and configure gatsby-remark-copy-linked-files. Install and configure gatsby-remark-copy-linked-files May 20, 2023
mstenta added a commit to mstenta/farmOS-community-blog that referenced this pull request May 20, 2023
mstenta added a commit to mstenta/farmOS-community-blog that referenced this pull request May 20, 2023
mstenta added a commit to mstenta/farmOS-community-blog that referenced this pull request May 20, 2023
mstenta added a commit to mstenta/farmOS-community-blog that referenced this pull request May 20, 2023
mstenta added a commit to mstenta/farmOS-community-blog that referenced this pull request May 20, 2023
@mstenta mstenta requested a review from wotnak May 22, 2023 12:02
@mstenta mstenta merged commit be7351b into farmOS:main May 22, 2023
5 checks passed
@mstenta mstenta deleted the gatsby-remark-copy-linked-files branch May 22, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants