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 support for image captions #1058

Closed
ragasirtahk opened this issue Jan 28, 2018 · 8 comments
Closed

Add support for image captions #1058

ragasirtahk opened this issue Jan 28, 2018 · 8 comments

Comments

@ragasirtahk
Copy link
Contributor

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
There is no option to add image caption when we insert an image.

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
There should be an option to add caption to images that a user inserts while writing a blog-post.

- Please mention your CMS, node.js, and operating system version.

- Please link or paste your config.yml below if applicable.
https://github.com/ragasirtahk/The-ragasirtahk-Blog/blob/master/static/admin/config.yml

@ragasirtahk
Copy link
Contributor Author

CMS: Hugo v0.33 + Netlify CMS hosted on Netlify and GitHub

@tech4him1
Copy link
Contributor

tech4him1 commented Jan 28, 2018

How would you want the caption saved into the markdown so that Hugo could use it?

@ragasirtahk
Copy link
Contributor Author

Check this out: https://gohugo.io/content-management/shortcodes#figure
The example there shows how Hugo uses markdown for figure caption

@tech4him1
Copy link
Contributor

To use shortcodes like that, you can use registerEditorComponent, docs here: https://www.netlifycms.org/docs/custom-widgets/#registereditorcomponent. If you need help, I can walk you through it.

@ragasirtahk
Copy link
Contributor Author

Thanks for the info. I think I will be able to use the component without any requirement of help.

@alxlion
Copy link

alxlion commented Jun 15, 2018

Someone has created a custom component for figure ?

@alxlion
Copy link

alxlion commented Jun 15, 2018

Just made a "quick and dirty" custom component for Hugo figures being compatible with src, caption, link and width options.

https://gist.github.com/lnalex/2881c29649bc5d477954f79b3071e408

@erquhart
Copy link
Contributor

Nice! You should consider packaging that up and publishing on npm.

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

No branches or pull requests

4 participants