normalize paths

This commit is contained in:
Chris Waring
2021-04-07 18:53:46 +01:00
parent cc90cba547
commit ec138b2ee9
@@ -1,3 +1,5 @@
const { normalize } = require('path')
export default {
created() {
if (typeof this.$ssrContext !== 'undefined') {
@@ -5,7 +7,8 @@ export default {
const og = meta && meta.find((m) => m.property === 'og:image')
if (meta && og) {
try {
const imgPath = require('@source/assets/' + og.content)
const assetPath = normalize(og.content).replace(/^\/|\/$/g, '')
const imgPath = require('@source/assets/' + assetPath)
const { pageMeta } = this.$ssrContext
this.$ssrContext.pageMeta = pageMeta.replace(
new RegExp(og.content, 'g'),