Replies: 5 comments 3 replies
-
"Image title" is the title of an image and not the caption :) Currently this theme uses your mentioned syntax to set the image title and I think it should stay like that because thats how default markdown in Hugo works. For anything more than "title", "filename" and "alt" you can use the builtin shortcode figure, which does have caption, link, etc...:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I'm converting a big WordPress blog to Hugo and most themes I tried do this. The image title field in markdown is used to set the figcaption element in HTML. This is a website I made with the DoIt theme. Captions are displayed, just by defining a title for the image in markdown.
|
Beta Was this translation helpful? Give feedback.
-
I converted my blog with ~2600 posts half a year ago and had some trouble with this topic, too. I asked myself why developers of Hugo would not implement such simple things like image captions into "their" markdown syntax. I started doing that myself and ended up with something that was not intuitive and that would not work anymore if I switched my blog theme. Then I realized how it works: Do the very basic stuff with a simple Markdown syntax and use shortcodes if you need more. So I use Markdown syntax for just images (+ alt text) and link them, if needed, with Markdown, too. If I need captions, width, height, ... I use the shortcode figure. And I think that a theme should be consistent with the Markdown syntax and not use data for something it was not created for, i. e. using "title" as "image caption". @razonyang If you consider implementing this please add a setting to use the default behavior "title is title" XOR "title becomes caption". :) |
Beta Was this translation helpful? Give feedback.
-
@LITUATUI @Natenom Just created a parameter Docs: https://hbs.razonyang.com/v1/en/docs/image-processing/#caption |
Beta Was this translation helpful? Give feedback.
-
Thanks @razonyang For some reason, it's not working here. I'll try to find out why. |
Beta Was this translation helpful? Give feedback.
-
Considering that in markdown we can't define a caption for an image, some themes already use the title field to put captions on images.
![Alt](/path/to/img.jpg “image title”)
Example
Would be great to have this feature on this theme!
Beta Was this translation helpful? Give feedback.
All reactions