Hugo Share on LinkedIn Image Metadata
The following should generally work, but using .webp
format for image and LinedIn at the time of this writing does not support this format. See Media File Types Supported on LinkedIn
Doing inline markdown image links does no work for regular post, but will not work with LinkedIn v2 share api.
Images should appear and can be confirmed with LinkedIn’s Post Inspector:
Steps:
- Visit https://www.linkedin.com/post-inspector/
- Enter URL and click on Inspect, should see the updated preview image
- Now try sharing your URL on LinkedIn
Share on LinkedIn Image Metadata
If you would like people to be able to share site’s content on LinkedIn, the source code on your site needs to comply Open Graph Protocol (OGP).
This feature built in Hugo’s Open Graph template
front-matter
Going to configure front-matter variables on individual pages.
Example with content/blog/my-post.md
with image named post-cover.png
Add the following to front-matter section content/blog/my-post.md
images:
- post-cover.png
Viewing html for post we can see "og:image"
has been added to the meta data.
<meta property="og:image" content="http://blog.com/images/post/post-cover.png">
Hugo uses the page title and description for the title and description metadata. The first 6 URLs from the images array are used for image
metadata.
Optional metadata can also be set:
- Date, published date, and last modified data are used to set the published time metadata
audio
andvideos
are URL arrays like images for the audio and video metadata tags- First 6 tags on the page are used for the tags metadata
- Series taxonomy is used to specify related “see also” pages by placing them in the same series
Summary
This ia great way to adding usability outside of Hugo’s static web content. No click baiting please!
Related Posts
2023 Phoenix VMUG UserCon
Introduction: The recent 2023 Phoenix VMUG UserCon brought together some like-minded people in the field, with discussions ranging from VMware technologies to best practices for optimizing existing systems.
Read moreRed Hat User Group Insights, Ansible Automation Platform, and ITSM Integration
Introduction: This blog post aims to summarize the key takeaways from this informative workshop. At the recent Red Hat User Group workshop on Red Hat Insights, Red Hat Ansible Automation Platform, and their integration with management (ITSM) systems, such as ServiceNow, provided valuable insights into how these technologies work together.
Read moreRobocopy Examples
Robocopy Examples Robocopy has many command line options and it can be overwhelming to know which commands to use. In this post, we will take a look at how to ues robocopy to copy, mirror, purge Files and Folders.
Read more