Skip to content

how to add linkedin shared button? #391

Answered by GaetanCottrez
eerison asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @eerison,

You just need to modify the src/components/ShareLinks.astro file by adding this object to the shareLinks array :

{
  name: "LinkedIn",
  href: `https://www.linkedin.com/sharing/share-offsite/?summary=${encodeURIComponent(
    `Look this post`
  )}&url=`,
  linkTitle: `Share this post on LinkedIn`,
},

And modify the src/assets/socialIcons.ts file by adding this object to the socialIcons array :

LinkedIn: `<svg
    xmlns="http://www.w3.org/2000/svg"
    class="icon-tabler"
    stroke-linecap="round"
    stroke-linejoin="round"
  >
    <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
    <rect x="4" y="4" width="16" height="16" rx="2"></rect>
    <line x1="8" y1="11" x…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eerison
Comment options

Answer selected by eerison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants