chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
572 stars 263 forks source link

Display remote images correctly. Fixes #266 #267

Closed rootwork closed 2 years ago

rootwork commented 2 years ago

This PR...

Fixes

Screenshots (if applicable)

This PR includes both a fix and an addition to the markdown-syntax.*.md files to document how images work and (I hope) prevent such a regression in the future. The fix and the content change are two separate commits in case you'd like the first but not the second. This is a screenshot of the post (with image sizes reduced so they'll fit in the screenshot):

fix-remote-image-loading_ss

While the images look the same, the first is loading the local image file and the second is loading the image from the GitHub repo. The error message is intentional, to show what happens when an image doesn't load.

Checklist

Ensure you have checked off the following before submitting your PR.

rootwork commented 2 years ago

Hmm, OK, so the build is failing because I included an example of an image that didn't exist to demonstrate the error message for a broken image.

Should I take that out, include a screenshot of the error message instead, or something else?

rootwork commented 2 years ago

Also to echo what I said on #266, this may require a follow-up. I realized in fixing this that the hard-coded directories here:

https://github.com/chipzoller/hugo-clarity/blob/master/layouts/_default/_markup/render-image.html#L19-L22

will break in two other ways:

So just to mark those as needing follow-up. They are much less common than the bug that this PR fixes, however.

onweru commented 2 years ago

@rootwork

Should I take that out, include a screenshot of the error message instead, or something else?

The latter please.

rootwork commented 2 years ago

@onweru Done.

rootwork commented 2 years ago

This is strange; it built successfully locally but is failing on this test. Let me see if I can figure it out.

rootwork commented 2 years ago

Just needed to copy the images to exampleSite. Ready to go now.