I want to set og:url in my Nuxt SSR project. I am attempting to do this in the nuxt.config.js file however I can not seem to get access to this.$route.path. This is my current code below.
nuxt.config.js
require('dotenv').config()
export default {
mode: 'universal',
target: 'static',
generate: {
fallback: true
},
env: {
baseUrl: process.env.BASE_URL || 'http://localhost:3000'
},
head: () => ({
meta: [
{
hid: 'og:url',
name: 'og:url',
content: process.env.baseUrl + this.$route.path
},
],
}),
}