Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update cookie consent and analytics scripts location #150

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 99 additions & 19 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ const siteStructuredData = {
{
'@id': 'https://docs.kuberocketci.io',
'@type': 'WebSite',
'url': 'https://docs.kuberocketci.io',
'name': 'KubeRocketCI Documentation',
'description': 'Explore KubeRocketCI Documentation for detailed guides, tutorials, and insights into KubeRocketCI CI/CD flow, platform components, and add-ons. Learn how to enhance your DevOps practices with KubeRocketCI.',
'sameAs': [
url: 'https://docs.kuberocketci.io',
name: 'KubeRocketCI Documentation',
description:
'Explore KubeRocketCI Documentation for detailed guides, tutorials, and insights into KubeRocketCI CI/CD flow, platform components, and add-ons. Learn how to enhance your DevOps practices with KubeRocketCI.',
sameAs: [
'https://medium.com/epam-delivery-platform',
'https://hub.docker.com/u/epamedp',
'https://epam.github.io/edp-install/',
Expand All @@ -33,7 +34,7 @@ const siteStructuredData = {
'query-input': 'required name=search_term_string',
},
inLanguage: 'en-UK',
}
},
],
};

Expand Down Expand Up @@ -74,19 +75,97 @@ const config: Config = {
},
innerHTML: JSON.stringify(siteStructuredData),
},
...(process.env.node_env === 'production'
? [
{
tagName: 'link',
attributes: {
rel: 'stylesheet',
href: '/css/cookie-consent.css',
},
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
src: 'https://cookie-cdn.cookiepro.com/consent/0194a78c-7932-70b9-abdc-9d8096b5f261/OtAutoBlock.js',
},
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
src: 'https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js',
charset: 'UTF-8',
'data-domain-script': '0194a78c-7932-70b9-abdc-9d8096b5f261',
},
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
},
innerHTML: 'function OptanonWrapper() {}',
},
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://www.google-analytics.com',
},
},
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://www.googletagmanager.com',
},
},
{
tagName: 'script',
attributes: {
src: 'https://www.googletagmanager.com/gtm.js?id=GTM-527T2HLF',
async: 'true',
},
},
{
tagName: 'script',
attributes: {
src: 'https://www.googletagmanager.com/gtag/js?id=G-4V1NZ8PQWG',
async: 'true',
},
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
},
innerHTML: 'window.dataLayer=window.dataLayer||[]',
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
},
innerHTML:
'function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-4V1NZ8PQWG",{})',
},
{
tagName: 'script',
attributes: {
type: 'text/javascript',
},
innerHTML:
'!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-527T2HLF",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")',
},
]
: []),
],

presets: [
[
'classic',
{
gtag: {
trackingID: 'G-4V1NZ8PQWG',
},
googleTagManager: {
containerId: 'GTM-527T2HLF',
},

docs: {
sidebarPath: './sidebars.ts',
showLastUpdateAuthor: true,
Expand All @@ -105,11 +184,12 @@ const config: Config = {

blog: {
blogTitle: 'Blog: CI/CD Insights, DevOps and Kubernetes Guides',
blogDescription: 'Explore KubeRocketCI Blog for the latest insights, tutorials, and guides on CI/CD practices, DevOps culture, and Kubernetes technologies.',
blogDescription:
'Explore KubeRocketCI Blog for the latest insights, tutorials, and guides on CI/CD practices, DevOps culture, and Kubernetes technologies.',
feedOptions: {
type: 'all',
copyright: `Copyright © ${new Date().getFullYear()} KubeRocketCI.`,
createFeedItems: async (params) => {
createFeedItems: async params => {
const { blogPosts, defaultCreateFeedItems, ...rest } = params;
return defaultCreateFeedItems({
// keep only the 10 most recent blog posts in the feed
Expand All @@ -130,10 +210,10 @@ const config: Config = {
priority: 0.5,
ignorePatterns: ['/docs/next/**', '/docs/3.9/**', '/docs/3.10/**', '/blog/tags/**'],
filename: 'sitemap.xml',
createSitemapItems: async (params) => {
createSitemapItems: async params => {
const { defaultCreateSitemapItems, ...rest } = params;
const items = await defaultCreateSitemapItems(rest);
return items.filter((item) => !item.url.includes('/page/'));
return items.filter(item => !item.url.includes('/page/'));
},
},
} satisfies Preset.Options,
Expand Down Expand Up @@ -256,13 +336,13 @@ const config: Config = {
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
type: "html",
type: 'html',
value: '<hr style="margin: 0.1rem">',
},
{
href: 'https://github.com/epam/edp-install/blob/master/RELEASES.md',
label: 'Releases',
}
},
],
},
{
Expand Down Expand Up @@ -298,7 +378,7 @@ const config: Config = {
{
label: 'API Reference: Use KubeRocketCI To Build Your Solutions',
to: '/docs/api/overview',
}
},
],
},
{
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
},
"dependencies": {
"@docusaurus/core": "^3.6.3",
"@docusaurus/plugin-google-tag-manager": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@docusaurus/theme-mermaid": "^3.6.3",
"@emotion/react": "^11.11.4",
Expand Down
23 changes: 1 addition & 22 deletions src/theme/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
import React from 'react';
import Head from '@docusaurus/Head';

export default function Root({ children }) {
return (
<>
<link rel="stylesheet" href="/css/cookie-consent.css" />
<Head>
<script
type="text/javascript"
src="https://cookie-cdn.cookiepro.com/consent/0194a78c-7932-70b9-abdc-9d8096b5f261/OtAutoBlock.js"
></script>
<script
src="https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js"
type="text/javascript"
charSet="UTF-8"
data-domain-script="0194a78c-7932-70b9-abdc-9d8096b5f261"
></script>
<script type="text/javascript">{`function OptanonWrapper() {}`}</script>
</Head>
{children}
</>
);
return <>{children}</>;
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@
"@types/gtag.js" "^0.0.12"
tslib "^2.6.0"

"@docusaurus/plugin-google-tag-manager@^3.6.3", "@docusaurus/plugin-google-tag-manager@3.6.3":
"@docusaurus/plugin-google-tag-manager@3.6.3":
version "3.6.3"
resolved "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.6.3.tgz"
integrity sha512-1M6UPB13gWUtN2UHX083/beTn85PlRI9ABItTl/JL1FJ5dJTWWFXXsHf9WW/6hrVwthwTeV/AGbGKvLKV+IlCA==
Expand Down