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

Add component to do figure & figcaption for images within MDX #571

Open
richwklein opened this issue Dec 24, 2023 · 0 comments
Open

Add component to do figure & figcaption for images within MDX #571

richwklein opened this issue Dec 24, 2023 · 0 comments
Labels
component React component enhancement New feature or request

Comments

@richwklein
Copy link
Owner

richwklein commented Dec 24, 2023

It would be nice to show a figure and figcaption for images in posts. We can do something with the img tag via shortcodes. See what we did with the <MDXLink> component. When the image has a title attribute we use that as the <figcaption> and we wrap the image in a <figure>.

We would need to figure out how that interacts with the remark-image plugin that is already being used. https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/?=prism#gatsby-remark--plugins

Here is an npm module that can give us inspiration https://www.npmjs.com/package/@bradleyburgess/img-figcaptions or https://github.com/leonardodino/gatsby-remark-figure-caption/tree/master

@richwklein richwklein added the enhancement New feature or request label Dec 24, 2023
@richwklein richwklein added the component React component label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component React component enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant