Reputation: 254
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.
Upvotes: 0
Views: 241
Reputation: 14904
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.
Upvotes: 1
Reputation: 2244
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
or fetch
. Either will run before your template is rendered, so you can grab your data and make it available before page load.
export default {
async asyncData({ store }) {
return {
blogData: store.state.blogs.find(blog => blog.id === 1)
}
}
}
Upvotes: 1