I have the following front matter in a markdown file.
---
title: "Hello world!"
excerpt: "Lorem ipsum dolor sit amet"
coverImage: "/assets/blog/hello-world/cover.png"
date: "2020-03-16T05:35:07.322Z"
author:
name: Mario
picture: "/assets/blog/authors/mario.png"
ogImage:
url: "/assets/blog/hello-world/cover.png"
---
I require passing the full url of the image to twitter card meta twitter: image and open graph meta property = "og: image"
For this I need to obtain the base url of the site to use it as a prefix to the image path that I obtain through front matter
<Head>
{/* Twitter */}
...
<meta name="twitter:image" content={data.ogImage.url} />
{/* Open Graph */}
...
<meta property="og:url" content={``} key="ogurl" />
<meta property="og:image" content={data.ogImage.url} key="ogimage" />
</Head>
For now data.ogImage.url has the value /assets/blog/hello-world/cover.png but in order to work I need to prefix this output with site base url
How do I get the base url of the site in nextjs?
