diff --git a/package.json b/package.json index 60e44bd63b..94b23e5154 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "scripts": { "serve": "yarn workspace vuestic-ui serve", "serve:book": "yarn workspace vuestic-ui serve", + "start:docs:ci": "yarn workspace docs start:ci", "serve:production": "yarn workspace vuestic-ui serve:production", "lint": "yarn workspace vuestic-ui lint", "build": "yarn workspace vuestic-ui build", diff --git a/packages/docs/components/HeaderBanner.client.vue b/packages/docs/components/HeaderBanner.vue similarity index 96% rename from packages/docs/components/HeaderBanner.client.vue rename to packages/docs/components/HeaderBanner.vue index ee45928287..92ca30c24b 100644 --- a/packages/docs/components/HeaderBanner.client.vue +++ b/packages/docs/components/HeaderBanner.vue @@ -101,6 +101,8 @@ import { ref } from 'vue' import { useElementTextColor } from 'vuestic-ui' +const officialPartnerCookie = useCookie('banner') + const props = defineProps({ closeable: { type: Boolean, @@ -115,11 +117,11 @@ const props = defineProps({ const textColor = useElementTextColor('primary') const closeable = ref(props.closeable) -const isHidden = ref(closeable.value && localStorage.getItem('banner') === 'official-partner') +const isHidden = ref(closeable.value && officialPartnerCookie.value === 'official-partner') const hide = () => { if (closeable.value) { - localStorage.setItem('banner', 'official-partner') + officialPartnerCookie.value = 'official-partner' isHidden.value = true } } diff --git a/packages/docs/composables/useDocsScroll.ts b/packages/docs/composables/useDocsScroll.ts index 9e24edcb13..7d198160b2 100644 --- a/packages/docs/composables/useDocsScroll.ts +++ b/packages/docs/composables/useDocsScroll.ts @@ -2,6 +2,7 @@ export const useDocsScroll = () => { const route = useRoute() const scrollTop = () => { + if (typeof document === 'undefined') { return } const pageContent = document.querySelector('.docs-layout__main-content') if (pageContent) { @@ -11,6 +12,7 @@ export const useDocsScroll = () => { const scrollToElement = () => { if (route.hash) { + if (typeof document === 'undefined') { return } const el = document.querySelector(route.hash) el?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' }) diff --git a/packages/docs/layouts/default.vue b/packages/docs/layouts/default.vue index 5c30a3e5c8..f1cbc2b467 100644 --- a/packages/docs/layouts/default.vue +++ b/packages/docs/layouts/default.vue @@ -1,5 +1,6 @@