diff --git a/package.json b/package.json index ca1489ba7..f37714a70 100644 --- a/package.json +++ b/package.json @@ -82,4 +82,4 @@ "engines": { "node": ">= 16.0.0" } -} \ No newline at end of file +} diff --git a/packages/docs/.env.example b/packages/docs/.env.example new file mode 100644 index 000000000..9cc1943c9 --- /dev/null +++ b/packages/docs/.env.example @@ -0,0 +1,5 @@ +PUBLIC_ORAMA_CLOUD_ENDPOINT= +PUBLIC_ORAMA_CLOUD_API_KEY= + +ORAMA_CLOUD_INDEX_ID= +ORAMA_CLOUD_PRIVATE_API_KEY= \ No newline at end of file diff --git a/packages/docs/astro.config.mjs b/packages/docs/astro.config.mjs index 2f0cd4886..9e31d5281 100644 --- a/packages/docs/astro.config.mjs +++ b/packages/docs/astro.config.mjs @@ -1,9 +1,9 @@ import { defineConfig } from 'astro/config' import starlight from '@astrojs/starlight' import react from '@astrojs/react' -import starlightImageZoom from 'starlight-image-zoom' import tailwind from '@astrojs/tailwind' import cookieconsent from '@jop-software/astro-cookieconsent' +import {openSourceMenu, oramaCloudMenu, head, cookieConsentConfig } from './config' // https://astro.build/config export default defineConfig({ @@ -16,466 +16,33 @@ export default defineConfig({ integrations: [ starlight({ pagefind: false, - plugins: [starlightImageZoom()], - title: 'Orama', - description: 'Your product answer engine.', + plugins: [], + title: 'Orama Docs', + description: 'Your product answer engine. Unlimited full-text search, embeddings generations and more. Help your users find the right answers, faster.', favicon: '/favicon.png', - head: [ - { - tag: 'link', - attrs: { - rel: 'apple-touch-icon', - sizes: '180x180', - href: '/apple-touch-icon.png' - } - }, - { - tag: 'link', - attrs: { - rel: 'icon', - type: 'image/png', - sizes: '32x32', - href: '/favicon-32x32.png' - } - }, - { - tag: 'link', - attrs: { - rel: 'icon', - type: 'image/png', - sizes: '16x16', - href: '/favicon-16x16.png' - } - }, - { - tag: 'link', - attrs: { - rel: 'mask-icon', - href: '/safari-pinned-tab.svg', - color: '#3a0839' - } - }, - { - tag: 'meta', - attrs: { - name: 'theme-color', - content: '#000' - } - }, - { - tag: 'script', - content: `!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId".split(" "),n=0;ncontact us' - } - ] - } - } - } - } - }) + cookieconsent(cookieConsentConfig) ] }) diff --git a/packages/docs/config/cookies.ts b/packages/docs/config/cookies.ts new file mode 100644 index 000000000..fb8517945 --- /dev/null +++ b/packages/docs/config/cookies.ts @@ -0,0 +1,74 @@ +const cookieConsentConfig = { + guiOptions: { + consentModal: { + layout: 'box', + position: 'bottom right', + equalWeightButtons: true, + flipButtons: false + }, + preferencesModal: { + layout: 'box', + position: 'right', + equalWeightButtons: true, + flipButtons: false + } + }, + categories: { + necessary: { + enabled: true, + readOnly: true + }, + analytics: { + enabled: true + } + }, + language: { + default: 'en', + translations: { + en: { + consentModal: { + title: 'We use cookies 🍪 ', + description: + 'We use cookies to ensure you get the best experience on our website. You can manage your preferences below.', + acceptAllBtn: 'Accept all', + acceptNecessaryBtn: 'Reject all', + showPreferencesBtn: 'Manage preferences' + }, + preferencesModal: { + title: 'Manage cookie preferences', + acceptAllBtn: 'Accept all', + acceptNecessaryBtn: 'Reject all', + savePreferencesBtn: 'Accept current selection', + closeIconLabel: 'Close modal', + sections: [ + { + title: 'Somebody said ... cookies? 🍪 ', + description: 'You can enable or disable different types of cookies: ' + }, + { + title: 'Strictly Necessary cookies', + description: + 'These cookies are essential for the proper functioning of the website and cannot be disabled.', + + //this field will generate a toggle linked to the 'necessary' category + linkedCategory: 'necessary' + }, + { + title: 'Performance and Analytics', + description: + 'These cookies collect information about how you use our website. All of the data is anonymized and cannot be used to identify you.', + linkedCategory: 'analytics' + }, + { + title: 'More information', + description: + 'For any queries in relation to our policy on cookies and your choices, please contact us' + } + ] + } + } + } + } +} + +export default cookieConsentConfig \ No newline at end of file diff --git a/packages/docs/config/head.ts b/packages/docs/config/head.ts new file mode 100644 index 000000000..44a57f6fa --- /dev/null +++ b/packages/docs/config/head.ts @@ -0,0 +1,55 @@ +const head = [ + { + tag: 'link', + attrs: { + rel: 'apple-touch-icon', + sizes: '180x180', + href: '/apple-touch-icon.png' + } + }, + { + tag: 'link', + attrs: { + rel: 'icon', + type: 'image/png', + sizes: '32x32', + href: '/favicon-32x32.png' + } + }, + { + tag: 'link', + attrs: { + rel: 'icon', + type: 'image/png', + sizes: '16x16', + href: '/favicon-16x16.png' + } + }, + { + tag: 'link', + attrs: { + rel: 'mask-icon', + href: '/safari-pinned-tab.svg', + color: '#3a0839' + } + }, + { + tag: 'meta', + attrs: { + name: 'theme-color', + content: '#000' + } + }, + { + tag: 'script', + content: `!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId".split(" "),n=0;n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/docs/src/assets/logo-light.svg b/packages/docs/src/assets/logo-light.svg new file mode 100644 index 000000000..c247c8140 --- /dev/null +++ b/packages/docs/src/assets/logo-light.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/docs/src/assets/logo-orama-dark.svg b/packages/docs/src/assets/logo-orama-dark.svg deleted file mode 100644 index 164257214..000000000 --- a/packages/docs/src/assets/logo-orama-dark.svg +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/docs/src/assets/logo-orama-light.svg b/packages/docs/src/assets/logo-orama-light.svg deleted file mode 100644 index d1621b7bd..000000000 --- a/packages/docs/src/assets/logo-orama-light.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/docs/src/assets/orama-logo.png b/packages/docs/src/assets/orama-logo.png deleted file mode 100644 index a3847aded..000000000 Binary files a/packages/docs/src/assets/orama-logo.png and /dev/null differ diff --git a/packages/docs/src/components/Header.astro b/packages/docs/src/components/Header.astro index d11f30127..dcb3a1ea7 100644 --- a/packages/docs/src/components/Header.astro +++ b/packages/docs/src/components/Header.astro @@ -8,109 +8,47 @@ import ThemeSelect from '@astrojs/starlight/components/ThemeSelect.astro' import { Search } from './Search' --- -
-
-