The following snippets can be used to get direct share links to Facebook, Twitter and LinkedIn in your page.html.twig. 

First, to your mytheme.theme, add

 * Implements hook_preprocess_page().
function mytheme_preprocess_page(&$variables) {
 if(isset($variables['node'])) {
    $variables['page_title'] = $variables['node']->title->value;
    $variables['page_title'] =$variables['page']['#title'];

Then, in page.html.twig:

<a href="{{ url('<current>') }}" class="btn-facebook">
  Share on Facebook
<a href="{{ url('<current>') }}&text={{ page_title }}" class="btn-twitter">
  Share on Twitter
<a href="{{ url('<current>') }}&title={{ page_title }}" class="btn-linkedin">
  Share on LinkedIn



Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!