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 image and figure shortcodes #233

Merged
merged 2 commits into from Jun 16, 2020
Merged

Add image and figure shortcodes #233

merged 2 commits into from Jun 16, 2020

Conversation

davidfeng88
Copy link
Contributor

@davidfeng88 davidfeng88 commented Jun 14, 2020

@alex-shpak
Copy link
Owner

alex-shpak commented Jun 15, 2020

Hi! Thank you for PR!

There is already built-in figure shortcode in hugo https://gohugo.io/content-management/shortcodes/
It seems like feature wise difference is mostly in position attribute. I think maybe it is better to add classes to control built-in shortcode position vs adding extra shortcode. Also will be less code to maintain in theme.

And then image shortcode can be just figure without a caption tag 🤔

What do you think?

@davidfeng88
Copy link
Contributor Author

davidfeng88 commented Jun 16, 2020

🤦 I did not know hugo has the figure shortcode! (When was it added?)

Yes, my pain point was to center an image. Totally agree that we should prefer CSS changes over additional shortcodes. Also agree that we don't need image shortcode.

After some googling I found out that text-align:center on the figure centers both the image and caption. PR updated!

Ref: https://www.freecodecamp.org/news/how-to-center-an-image-using-text-align/

@alex-shpak
Copy link
Owner

alex-shpak commented Jun 16, 2020

👍 Cool, that should do.
Probably figure tag styles in markdown needs some love (like margins and etc), I will take a look.

@alex-shpak alex-shpak merged commit c79ab9d into alex-shpak:master Jun 16, 2020
@davidfeng88 davidfeng88 deleted the figure-image branch Jun 17, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants