docs: add ketch management banner (#7503)
* feat: Add Ketch consent management and privacy preference link to docusaurus config * feat: Update Docusaurus footer and Ketch privacy management - Modify Ketch script configuration for better performance - Enhance footer styling with dark theme and copyright - Add dynamic load for region-specific privacy link - Update sitemap configuration to ignore preferences page * Styled footer * fix-merge-error * update script to remove link if in default jurisdiction and handle GA… (#7508) * update script to remove link if in default jurisdiction and handle GA4 tracking * add test ketch property so we can test in feature branch * Fix ketch script issue (#7509) * add new html sidebar item with custom styles and new font * update script to remove link if in default jurisdiction and handle GA4 tracking * add test ketch property so we can test in feature branch * fix script for ketch --------- Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * Fix Ketch script again (#7513) * add new html sidebar item with custom styles and new font * update script to remove link if in default jurisdiction and handle GA4 tracking * add test ketch property so we can test in feature branch * fix script for ketch * Update footer css and fix ketch script * add production logic back in --------- Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> * remove-region-check * make-footer-not-hide-ad --------- Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com> Co-authored-by: Cole Goldsmith <cole.b.goldsmith@gmail.com>
This commit is contained in:
parent
3f69e38f65
commit
0bf81f0bdc
2 changed files with 148 additions and 38 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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: `<div class="footer-links">
|
||||
<span>© ${new Date().getFullYear()} Langflow</span>
|
||||
<span id="preferenceCenterContainer"> · <a href="/cookies">Manage Privacy Choices</a></span>
|
||||
</div>`,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
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",
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue