Some projects require you to add social share buttons for their pages. I’m gonna show you a simple way to do this using the Socialitejs JavaScript library.

First you’re gonna have to download the Socialitejs library, save it to your bundle Resources/public/js folder and publish the assets.

If you have a general layout that is inherited by all your specific page templates (like it’s usually the case), just add the share code in it like so:

As you can see, this code will generate specific URLs for each page using the app.request.getUri code.

You can also use the following CSS as a starting point if you need to customize the buttons: