# קידוד URL ביציאות פלאגין

**URL:** <https://meta.discourse.org/t/how-to-encode-urls-for-linkedin-share-buttons-in-discourse/299891>\
**Category:** Development\
**Created:** [18 במרץ,‏ 2024,‏ 11:36pm UTC](https://meta.discourse.org/t/how-to-encode-urls-for-linkedin-share-buttons-in-discourse/299891 "2024-03-18T23:36:20Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![bruno\_at\_dq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@bruno\_at\_dq](https://meta.discourse.org/u/bruno_at_dq)\
**Post date:** [18 במרץ,‏ 2024,‏ 11:36pm UTC](https://meta.discourse.org/t/how-to-encode-urls-for-linkedin-share-buttons-in-discourse/299891/1 "2024-03-18T23:36:20Z")

</div>

I’m trying to add a LinkedIn share button to badges in a **Discourse-hosted** community I’m an admin in.

To this end, I’m trying to use [this Plugin Outlet](https://github.com/discourse/discourse/blob/f8964f8f8ff1e386c50f22c804691191f546e9f8/app/assets/javascripts/discourse/app/components/badge-card.hbs#L30-L33). I included the following code in the head section of a theme.

```html
<script type='text/x-handlebars' data-template-name='/connectors/badge-contents-top/linkedin-button'>
  <a href="https://www.linkedin.com/profile/add?certUrl=https://community.my_community.io{{@outletArgs.url}}" class="linkedin-share-button">
    <img src="https://download.linkedin.com/desktop/add2profile/buttons/en_US.png " alt="LinkedIn Add to Profile button">
  </a>
</script>

```

Please note `href` attribute: `https://www.linkedin.com/profile/add?certUrl=https://community.my_community.io/{{@outletArgs.url}}`.

The `@outletArgs.url` value looks something like `https://community.my_community.io/badges/<badge_id>/<badge_name>?username=<username>`. I want to focus on the `username=<username>` part.

The URL is not encoded, the equal sign is being passed literally, so when the browser processes `https://www.linkedin.com/profile/add?certUrl=https://community.my_community.io/https://community.my_community.io/badges/<badge_id>/<badge_name>?username=<username>`, it ignores `=<username>`.

How do I encode the URL here?

---

_[View the full topic](https://meta.discourse.org/t/how-to-encode-urls-for-linkedin-share-buttons-in-discourse/299891)._
