I’m planning on storing the majority of the texts for my blog in vuex for fast loading speed. Is this a good idea especially for SEO or should i create individual routes for all posts? I definitly do not know alot about SEO and I’m also new to vue/nuxt, before I’ve used mostly vanilla javascript.
3
Answers
If you’re wondering about Google’s ability to see the content, I wouldn’t worry. I’ve tested a number of similar situations and even when data is pulled in via an external API, Google has been happy to wait a little while to see how the page renders and crawl the result.
However if you’re worried, just generate your component data using
asyncData
orfetch
. Either will run before your template is rendered, so you can grab your data and make it available before page load.Nuxt asyncData
You can but its defenetly not recommended to do it like that.
Nuxt offers a good module for writing blogs https://nuxtjs.org/blog/creating-blog-with-nuxt-content
Works for static sites too. They get pre-rendered.
I would not use VueX to store the blog posts, especially if you are using all static content.
Nuxt has a wonderful package, nuxt content that is designed for this. It used markdown pages for blog posts.
Then I would use the nuxt seo package to super charge the SEO of your site. With it, you can easily set your default site SEO settings like Twitter handle and image. Then you can update the social media images for each blog posts you have, getting that data directly from
nuxt content
.