Hugo Share on LinkedIn Image Metadata

  • vnull
  • Pub Jan 1, 2023
  • Edited Jan 2, 2023
  • 2 minutes read

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:

  1. Visit https://www.linkedin.com/post-inspector/
  2. Enter URL and click on Inspect, should see the updated preview image
  3. 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">
Note

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 and videos 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!

Do you have an idea or suggestion for a blog post? Submit it here!

Related Posts

2023 Phoenix VMUG UserCon

  • vnull
  • Sep 8, 2023
  • 4 minutes read

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 more

Red Hat User Group Insights, Ansible Automation Platform, and ITSM Integration

  • vnull
  • Jun 1, 2023
  • 3 minutes read

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 more

Robocopy Examples

  • vnull
  • Feb 10, 2023
  • 5 minutes read

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