Home

Issue: 2544

Generating full absolute url for social icons

[issue link]

Little help here, couldn’t figure out how to generate the full url (http://url.com/blog/this-is-a-blog-post) to be exported into facebook’s sharing link https://www.facebook.com/sharer/sharer.php?u=${url}

Each of the blog post is retrieved via asyncData from a headless CMS. So I only have a slug this-is-a-blog-post to work with.

Ideally I’d like to use this.$route to generate the full url but none of the methods show how. Also taking into consideration I am using SSR, so the url is generated serverside, hence I cannot use window.location that is clientside.

Help appreciated 😃

This question is available on Nuxt.js community (#c2211)