Modify structured-data value

51 views Asked by At

I'm working on a project develeoped in Nuxt+Storyblok. And for the blog posts I need to replace @type in current structured-data markup with a new value. But I cannot find a way to modify it in storyblok dashboard or with Nuxt.

I wrote the below code in head() function in Nuxt. Though it adds the script tag, it doesn't override it. Actually it adds another script tag with the specified values. So I assumed this should be done in storyblok but didn't find anything online. Any help is highly appreciated.

 head() {
    let structuredData = null;
        structuredData = {
            '@context': 'https://schema.org',
            '@type': this.blok.type || 'Medical Web Page',
            'headline': this.getTitle,
            'image': this.getMediaUrl,
            'datePublished': this.publishedAt,
            'dateModified': this.lastEdited,
        };
   
    return {
            script: [{
                    type: 'application/ld+json',
                    json: structuredData,
                }],
           },
    };
0

There are 0 answers