petersopko
petersopko
NNuxt
Created by petersopko on 6/11/2024 in #❓・help
Dynamic Blog Posts and SEO/metatags
Hello, I have a question I’m trying to resolve regarding blog posts and dynamic routing with SEO. I have created a new web for our company, and when it comes to blog posts they are fetched from external CMS system we’re using. The app loading works as follows: 1. store for blogs is initialized with call to api/blog which calls the external api 2. all of the blogs are stored in pinia with persistence in session storage -> so the external api is called only once unless refreshed 3. subsequently the pages/blog/[id].vue loads the blog from store instantly, with useHead filling up with metatags from api This works well, however, only after the blog loads. For example, the preview of the blog link in messaging app/social media, is the same as in app.vue. Once the blog is loaded and the useHead filled with data from api, the SEO/metatags are appearing correctly in browser. I’m guessing that the problem is I am handling all of this on client side instead of server side? Can somebody advise me on how to solve this efficiently? I don’t want to make external api calls more than once (upon loading the website)
7 replies