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

Inconsistent picture rendering #828

Closed
tomy0000000 opened this issue Mar 11, 2024 · 1 comment
Closed

Inconsistent picture rendering #828

tomy0000000 opened this issue Mar 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tomy0000000
Copy link
Contributor

Issue description

According to the shortcode documentation, the following two methods of image rendering should yield the same result:

{{< figure
    src="pittsburgh-in-snow.jpg"
    alt="Abstract purple artwork"
    caption="Test"
>}}
![Abstract purple artwork](pittsburgh-in-snow.jpg "Test")

However, this seems to be different...

CleanShot 2024-03-11 at 16 18 47@2x

The problem here seems to be that they're rendered with different templates:

  • figure shortcode use the layouts/shortcodes/figure.html shortcode template
  • Markdown uses the layouts/_default/_markup/render-image.html render hook

Kind of confusing to understand the purpose of the figure shortcode, but after getting to know this better, I may be able to work on a fix for this.

Theme version

v2.8.1

Hugo version

hugo v0.123.4-21a41003c4633b142ac565c52da22924dc30637a+extended darwin/amd64

Which browser rendering engines are you seeing the problem on?

Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.)

URL to sample repository or website

No response

Hugo output or build error messages

No response

@tomy0000000 tomy0000000 added the bug Something isn't working label Mar 11, 2024
@jpanther
Copy link
Owner

The figure shortcode is just to provide a way of adding images using shortcodes as this is how a lot of themes work and so this is a way for people to port their existing content to the theme with minimal friction. The render hook for markdown images is simply a shortcut (that was only introduced in more recent versions of Hugo).

The intent is for both methods to output their images using the same design and styling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants