Thanks for reporting this! I’ve dug into it and see that LinkedIn is returning two separate IDs to us. There is the share ID for the post response that we are currently saving, and there is another “activity” URI.
I’m not sure if this was a change or just something we never fully understood. I can’t get LinkedIn to recognize the share ID.
To avoid breaking anything further, I’m going to add a new field that is available to Hugo templates: .Params.linkedin.activity that is the format “urn:li:activity:12345”.
Is there any way to get this working for historical posts? A new post works great, but older posts seem to have the .Params.linkedin.activity missing: https://www.linkedin.com/feed/update/<nil>/
{{ if or ( .Params.bluesky ) ( .Params.linkedin ) }}
<span class="syndication">
{{ if .Params.bluesky.url }}
<a class="u-syndication icon fa-brands fa-bluesky" {{ printf "href=%q" .Params.bluesky.link | safeHTMLAttr }} ></a>
{{ end }}
{{ if .Params.linkedin.id }}
<a class="u-syndication icon fa-brands fa-linkedin" href="https://www.linkedin.com/feed/update/{{ ( print .Params.linkedin.activity ) | safeHTMLAttr }}" ></a> {{ end }}
</span>
{{ end }}
For now I would change the if .Params.linkedin.id to check .Params.linkedin.activity instead. That way if it’s blank for older posts, it just won’t show the link to LinkedIn.
There might be a way for us to rebuild the historical post data using the LinkedIn API, but I’m not sure yet.