Skip to content

Commit f5e1a1f

Browse files
Merge pull request #10 from Couchbase-Ecosystem/add-reo-analytics
Add Reo.dev analytics tracking
2 parents fa41e3c + 3f6539b commit f5e1a1f

File tree

6 files changed

+131
-237
lines changed

6 files changed

+131
-237
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
run: yarn install --frozen-lockfile
2626
- name: Build website
2727
run: yarn build
28+
env:
29+
REO_CLIENT_ID: ${{ vars.REO_CLIENT_ID }}
2830

2931
- name: Deploy to GitHub Pages
3032
uses: peaceiris/actions-gh-pages@v3

.github/workflows/test-deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ jobs:
2121
- name: Install dependencies
2222
run: yarn install --frozen-lockfile
2323
- name: Test build website
24-
run: yarn build
24+
run: yarn build
25+
env:
26+
REO_CLIENT_ID: ${{ vars.REO_CLIENT_ID }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ build
4646
coverage
4747
.docusaurus
4848
.cache-loader
49+
.env
4950
types
5051
test-website
5152
test-website-in-workspace

docusaurus.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
import 'dotenv/config';
23
import {themes as prismThemes} from 'prism-react-renderer';
34

45
/** @type {import('@docusaurus/types').Config} */
@@ -24,6 +25,14 @@ const config = {
2425
onBrokenLinks: 'warn',
2526
onBrokenMarkdownLinks: 'warn',
2627

28+
headTags: [
29+
{
30+
tagName: 'script',
31+
attributes: {},
32+
innerHTML: `!function(){var e,t,n;e="${process.env.REO_CLIENT_ID}",t=function(){Reo.init({clientID:"${process.env.REO_CLIENT_ID}"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}();`,
33+
},
34+
],
35+
2736
// Even if you don't use internationalization, you can use this field to set
2837
// useful metadata like html lang. For example, if your site is Chinese, you
2938
// may want to replace "en" with "zh-Hans".

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@docusaurus/preset-classic": "3.6.3",
1919
"@mdx-js/react": "^3.1.0",
2020
"clsx": "^2.1.1",
21+
"dotenv": "^17.3.1",
2122
"prism-react-renderer": "^2.4.0",
2223
"react": "^18.3.1",
2324
"react-dom": "^18.3.1"

0 commit comments

Comments
 (0)