diff --git a/docs/css/custom.css b/docs/css/custom.css index d9f4579e7..6f7e23aed 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -226,7 +226,7 @@ body { max-width: 100%; max-height: 500px; } - + .resized-image { width: 100%; max-width: 300px; @@ -277,18 +277,77 @@ body { margin-top: 0.15rem !important; } +/* Footer Styles */ +.footer { + padding: 8px 0; + background-color: var(--ifm-navbar-background-color); +} + +[data-theme="light"] .footer { + border-top: 1px solid var(--ifm-color-emphasis-300); +} + +.footer-content { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 var(--ifm-navbar-padding-horizontal); + max-width: var(--ifm-container-width); + margin: 0 auto; + font-size: 12px; +} + +.footer__copyright { + color: var(--ifm-toc-link-color); +} + +.footer-links { + display: flex; + gap: 0.5rem; + font-size: 13px; +} + +.footer-links a { + color: var(--ifm-toc-link-color); + text-decoration: none; +} + +.footer-links a:hover { + text-decoration: underline; +} + +.footer .container { + padding: 0 5rem; + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row-reverse; +} + +/* Sidebar Styles */ +.theme-doc-sidebar-container nav.menu { + padding-bottom: 0; +} + +.theme-doc-sidebar-menu { + display: flex; + flex-direction: column; + height: 100%; +} + +.theme-doc-sidebar-menu > :nth-last-child(2) { + margin-bottom: auto; +} + +/* Sidebar Ad Styles */ .sidebar-ad { margin-left: -0.5rem; margin-right: -0.5rem; - margin-bottom: 0; + margin-top: 1rem; border-radius: 0; border-top: 1px solid var(--ifm-color-emphasis-300); - border-bottom: 1px solid var(--ifm-color-emphasis-300); - background-color: var(--ifm-background-color); - position: fixed; + position: sticky; bottom: 0; - z-index: 100; - width: var(--doc-sidebar-width); } [data-theme="dark"] .sidebar-ad { diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 8a3f65617..d1c4db893 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -5,6 +5,8 @@ const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); const { remarkCodeHike } = require("@code-hike/mdx"); +const isProduction = process.env.NODE_ENV === "production"; + /** @type {import('@docusaurus/types').Config} */ const config = { title: "Langflow Documentation", @@ -31,7 +33,48 @@ const config = { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Sora:wght@550;600&display=swap", }, - } + }, + ...(isProduction + ? [ + // Ketch consent management script + { + tagName: "script", + attributes: {}, + innerHTML: `!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="https://global.ketchcdn.com/web/v3/config/datastax/langflow_org_web/boot.js",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}();`, + }, + // Ketch jurisdiction dynamic link and GA4 consent tracking + { + tagName: "script", + attributes: { + defer: "true", + }, + innerHTML: ` + ;(function () { + const onKetchConsentGtagTrack = (consent) => { + if (window.gtag && + consent.purposes && + 'analytics' in consent.purposes && + 'targeted_advertising' in consent.purposes + ) { + const analyticsString = consent.purposes.analytics === true ? 'granted' : 'denied' + const targetedAdsString = consent.purposes.targeted_advertising === true ? 'granted' : 'denied' + const gtagObject = { + analytics_storage: analyticsString, + ad_personalization: targetedAdsString, + ad_storage: targetedAdsString, + ad_user_data: targetedAdsString, + } + window.gtag('consent', 'update', gtagObject) + } + } + if (window.ketch) { + window.ketch('on', 'consent', onKetchConsentGtagTrack) + } + })() + `, + }, + ] + : []), ], presets: [ @@ -64,6 +107,7 @@ const config = { lastmod: "datetime", changefreq: null, priority: null, + ignorePatterns: ["/preferences"], }, gtag: { trackingID: "G-SLQFLQ3KPT", @@ -96,7 +140,7 @@ const config = { "/whats-new-a-new-chapter-langflow", "/👋 Welcome-to-Langflow", "/getting-started-welcome-to-langflow", - "/guides-new-to-llms" + "/guides-new-to-llms", ], }, { @@ -122,10 +166,7 @@ const config = { }, { to: "/concepts-components", - from: [ - "/components", - "/components-overview" - ], + from: ["/components", "/components-overview"], }, { to: "/configuration-global-variables", @@ -141,45 +182,36 @@ const config = { }, { to: "/concepts-objects", - from: [ - "/guides-data-message", - "/configuration-objects", - ] + from: ["/guides-data-message", "/configuration-objects"], }, { to: "/blog-writer", - from: [ - "/starter-projects-blog-writer", - "/tutorials-blog-writer" - ], + from: ["/starter-projects-blog-writer", "/tutorials-blog-writer"], }, { to: "/memory-chatbot", from: [ "/starter-projects-memory-chatbot", - "/tutorials-memory-chatbot" + "/tutorials-memory-chatbot", ], }, { to: "/document-qa", - from: [ - "/starter-projects-document-qa", - "/tutorials-document-qa" - ], + from: ["/starter-projects-document-qa", "/tutorials-document-qa"], }, { to: "/starter-projects-simple-agent", from: [ "/math-agent", "/starter-projects-math-agent", - "/tutorials-math-agent" + "/tutorials-math-agent", ], }, { to: "/sequential-agent", from: [ "/starter-projects-sequential-agent", - "/tutorials-sequential-agent" + "/tutorials-sequential-agent", ], }, { @@ -198,7 +230,7 @@ const config = { to: "/configuration-authentication", from: [ "/configuration-security-best-practices", - "/Configuration/configuration-security-best-practices" + "/Configuration/configuration-security-best-practices", ], }, { @@ -207,15 +239,12 @@ const config = { "/configuration-auto-saving", "/Configuration/configuration-auto-saving", "/configuration-backend-only", - "/Configuration/configuration-backend-only" + "/Configuration/configuration-backend-only", ], }, { to: "/concepts-publish", - from: [ - "/concepts-api", - "/workspace-api", - ] + from: ["/concepts-api", "/workspace-api"], }, { to: "/components-custom-components", @@ -300,14 +329,36 @@ const config = { hideable: false, }, }, + footer: { + logo: { + alt: "Langflow", + src: "img/langflow-logo-black.svg", + srcDark: "img/langflow-logo-white.svg", + width: 160, + height: 40, + }, + links: [ + { + title: null, + items: [ + { + html: ``, + }, + ], + }, + ], + }, algolia: { - appId: 'UZK6BDPCVY', + appId: "UZK6BDPCVY", // public key, safe to commit - apiKey: 'adbd7686dceb1cd510d5ce20d04bf74c', - indexName: 'langflow', + apiKey: "adbd7686dceb1cd510d5ce20d04bf74c", + indexName: "langflow", contextualSearch: true, searchParameters: {}, - searchPagePath: 'search', + searchPagePath: "search", }, }), };