useStatamicSite

Gitlab
Get the current site identifier based on the i18n locale properties or the multi-tenancy site identifier.
Added since: v1.0.0
Last changed:
This composables functionality is replaced by the useStatamicMultiTenancySite composable when the multiTenancy option is enabled.

Usage

The useStatamicSite composable is used to get the current site identifier based on the i18n locale properties or the multi-tenancy site identifier.

Basic example

pages/blogs.vue
<script setup lang="ts">
const 
site
=
useStatamicSite
();
</script>

Type Definition

function 
useStatamicSite
():
ComputedRef
<string | undefined>

API Reference

Return Value

ComputedRef<string | undefined>
The site identifier (language, or code).

The site identifier is retrieved from the i18n locale properties or the multi-tenancy site identifier.

Changelog

v1.0.0

on

#407d36db

-

feat: released initial version of nuxt-statamic