Open LitKnd opened 3 years ago
So useful, just fixed my website! Thanks.
Thanks for the tips! I discovered that Twitter Cards do not support relative URLs. I enabled relativeURLs = true
in my config.toml since I have a local GitLab instance installed on my server with GitLab Pages enabled. My local GitLab Pages would not render properly with the baseURL
of my public website since the local URL is different. Because I want a local deployment for development purposes, I had to update my front matter to include the full URL for the images parameter. It's a bit ugly but allows everything to work properly on my local and public website:
images:
- https://mypublicwebsite.com/post/image.jpg
Thank you for this! Very helpful to have a practical example. As @dlcasto said, I also could not get relative urls working for twitter cards, so I also hardcoded the image links. Not too onerous for a small site, but never would have found that solution if not for this post.
Comments left here will appear on http://www.littlekendra.com/2021/05/07/how-i-got-twitter-cards-working-hugo-mainroad/