Skip to content

Commit ea82015

Browse files
authored
Add Cookiebot (#108)
Use auto blockingmode Set cbid production value in antora playbook, but allow to be over -written by a local env variable for testing with staging value
1 parent 6c21313 commit ea82015

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.env.copy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ALGOLIA_APP_ID=
22
ALGOLIA_ADMIN_KEY=
33
ALGOLIA_INDEX_NAME=circleci-docs
4+
COOKIEBOT=
45
SEGMENT_WRITE_KEY=
56
SKIP_INDEX_SEARCH=true

antora-playbook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ site:
22
title: CircleCI Documentation
33
url: https://circleci.com/docs
44
robots: allow
5+
keys:
6+
cookiebot: a28b71f3-4d2e-4eac-93bc-34929948dd7d
57
content:
68
sources:
79
- url: .

gulp.d/tasks/build-site.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ console.log('Resolved path:', resolvedPath);
99

1010
module.exports = function buildSite(cb) {
1111
console.log('Starting Antora build...')
12-
exec(`npx antora ${antoraPlaybook} --log-failure-level=warn --extension ${resolvedPath} --extension ${resolvedPathExportExtension} --key segment_write=${process.env.SEGMENT_WRITE_KEY || null}`, (err, stdout, stderr) => {
12+
exec(`npx antora ${antoraPlaybook} --log-failure-level=warn --extension ${resolvedPath} --extension ${resolvedPathExportExtension} --key segment_write=${process.env.SEGMENT_WRITE_KEY || null} ${process.env.COOKIEBOT ? `--key cookiebot=${process.env.COOKIEBOT}` : ''}`, (err, stdout, stderr) => {
1313
console.log(stdout)
1414
if (stderr) console.error(stderr)
1515
if (err) return cb(err)

ui/src/partials/head-scripts.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
{{#with site.keys.cookiebot}}
2+
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="{{this}}" data-blockingmode="auto" type="text/javascript"></script>
3+
{{/with}}
14
{{#with site.keys.googleAnalytics}}
25
<script async src="https://www.googletagmanager.com/gtag/js?id={{this}}"></script>
36
<script>function gtag(){dataLayer.push(arguments)};window.dataLayer=window.dataLayer||[];gtag('js',new Date());gtag('config','{{this}}')</script>

0 commit comments

Comments
 (0)