-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
How to center the text in a caption? #246
Comments
Have you tried using both the Example: {{< figure src="/img/whatever.png" title="Caption goes here" >}}
{{< figure src="/img/whatever.png" caption="Caption goes here" >}} |
@kdkasad both the |
@Jarmos-san That is how the caption looks by default, as provided by hugo. |
@adityatelange what do you think about changing the look of the |
@kdkasad if you could change how Besides, the implementation details don't appear too difficult either. And I see you had plans to customize the caption text similar to how it shows up under the Anyway, thanks for the great work! ❤️ Without the contributions you guys are making, developers like me with no experience whatsoever with frontend stuff would perish. That said, do link the PR with this issue thread, so it can be closed. @adityatelange your opinion? |
I'm going to open a PR sometime soon with a reworked caption layout. I plan to make both the title and caption appear centered directly below the image. The title will be bold and will have the primary color. The caption will be directly below the title, and will be a normal font weight with the secondary color. I'll also adjust the style of the cover image's caption to match. Here's a screenshot of the paperesque theme, which follows the same layout but with a different style: |
Looks good to me! I'm surprised to see Hugo's |
I was of the opinion that let the figure shortcode the way it is presented by hugo |
The issue I thought for customizing captions in #127 inside the post was Cover image is meant to be full sized and fits the width. While in case of images inside a post, the images can be smaller than width of Ex. Originally posted by @adityatelange in #247 (comment) |
@adityatelange makes sense, you're right. In that case, wouldn't it make sense to also center the image as well? In other words, you could provide a customize version of the |
If we're doing that, I'd recomend just providing an |
We have multilingual configs with us, align values won't work properly there is what I would say |
In that case the theme is free to be personalized and customized as one wants
Originally posted by @Jarmos-san in #239 (comment) |
Got it now! So, unless you configure the What's a better alternative in your opinion then? |
I actually disagree with this. I think a custom
This would add support for custom image alignment without breaking any functionality for right-to-left languages. If I am wrong, please correct me. I do not deal with RTL languages, so I'm probably missing something. I also think that if we were to add this Edit: I've pushed a proof-of-concept branch at kdkasad@29f7fe0a904597a2f0a5965e05310c8fb0b3941d. There's a test page in the example site at kdkasad@605c805feae682e1817ea1a0f728c6890118f3ff. |
@kdkasad Amazing, that works flawlessly, can we have a PR with only center align included ? |
Related to #241. As suggested, I did use the provided shortcode
figure
& it "works" but not as intended.I was trying to caption an image like this:
But the formatting of the text in the caption generated by Hugo is like this:
What am I doing wrong? Or am I missing some feature of your theme? I see you provide a customized version of the
figure
shortcode withPaperMod
. So, perhaps I'm not using it the right way?Any guidance will be much appreciated.
The text was updated successfully, but these errors were encountered: