I am making a project with nextjs, it runs on wildcard subdomain like *.example.com.
The use can add his custom domain.
It us his own store.
What I need is, the owner store be found online on search engines
Is that possible with ssg?
Or I need ssr?
Or that's not possible with tenant apps?
If possible how to do so?
Thanks!
CodePudding user response:
Yes, Nuxt.js static single-page application (SPA) tenant sites can have search engine optimization (SEO) and be found on Google. Nuxt.js is a framework for building server-rendered or statically-generated applications using Vue.js, and it provides built-in support for SEO and for generating static versions of your application.
To enable SEO for a Nuxt.js static SPA tenant site, you can use the head
property in your Nuxt.js components to define the metadata and other information that will be used by search engines to index your site. This property allows you to specify the title, description, and other relevant information for each page of your site, which will be included in the generated HTML and used by search engines to understand the content of your site.
For example, you can define the head property in your Nuxt.js component like this:
export default {
head: {
title: 'My Nuxt.js SPA Tenant Site',
description: 'This is my Nuxt.js SPA tenant site, with SEO enabled.',
meta: [
{ name: 'keywords', content: 'nuxt.js, spa, tenant, seo' },
{ property: 'og:title', content: 'My Nuxt.js SPA Tenant Site' },
{ property: 'og:description', content: 'This is my Nuxt.js SPA tenant site, with SEO enabled.' }
]
}
}
In this example, the head
property is used to define the title, description, and meta tags for the page. This information will be included in the generated HTML and used by search engines to index and rank your site.
Once you have enabled SEO for your Nuxt.js static SPA tenant site, you can use the nuxt generate command to generate a static version of your site. This will create a set of HTML, JavaScript, and other files that can be deployed to a web server and accessed by users and search engines.
Once your static Nuxt.js SPA tenant site is deployed, it can be indexed by search engines and found on Google. You can use Google Search Console and other tools to track the performance of your site and ensure that it is being properly indexed and ranked by Google.