Site config aims to be two things:
useSiteConfig, createSitePathResolver, withSiteUrl, getNitroOrigin, etc@nuxtjs/i18nurlA canonical site URL is important for SEO and performance
envThe environment the site is running in, importing so we can disable indexing for non-production environments.
See this issue on why we can't use process.env.NODE_ENV.
indexableCan the site be indexed by search engines? Sometimes we have production sites that we don't want to be indexed.
nameThe name of the site is often used in meta tags and other SEO related tags
trailingSlashTrailing slashes are important for SEO and performance.
Not having a single source of truth for site config can be difficult to maintain and error-prone, for end-users and module authors.
Requiring a lot of duplication and boilerplate code to support the same features across modules.
Nuxt Site Config aims to unify the experience of site config with a set of powerful and flexible APIs for end-users and module authors.
Nuxt itself provides a great SSR utility for getting the site URL from the request headers at runtime.
However, this has two major drawbacks:
www.example.com and example.com)site on runtime config?Yes. In fact, this module uses site on the runtime config under the hood.
It aims to keep all these in sync, resulting in a single source of truth for site config.
See How it works for more details.
We should be able to spin up multi-tenant or multi-lingual Nuxt app with minimal effort, and Nuxt modules should just work, without any additional configuration.
This is quite far off, but it sets a good direction for the module.