jungvonmatt / wekit

A Jamstack kit for Contentful, Hugo and Netlify.
https://www.wekit.dev
MIT License
14 stars 4 forks source link

Fix: Use correct URL for share image #53

Closed peterschewe closed 1 year ago

peterschewe commented 1 year ago

This PR corrects the URL of the share image.

By default the asset urls come from Contentful without prototcol – e.g.:

//images.ctfassets.net.../share_image.jpg

But the real absolute URL including prototol is needed.

Otherwise the image will be resolved like this:

https://www.yourdomain.com//images.ctfassets.net.../share_image.jpg

In addition, the code snippet was moved to a util because we already use the pattern (Hugo function absURL + protocol) in other places.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication