Skip to content

Commit 79ef507

Browse files
Added changes for Reo analytics
1 parent 758952f commit 79ef507

6 files changed

Lines changed: 137 additions & 212 deletions

File tree

.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
@@ -18,6 +18,7 @@ build
1818
coverage
1919
.docusaurus
2020
.cache-loader
21+
.env
2122
types
2223
test-website
2324
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
clientModules: [
2837
'./src/clientModules/scarfAnalytics.js',
2938
],

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.1.1",
1919
"@mdx-js/react": "^3.0.0",
2020
"clsx": "^2.0.0",
21+
"dotenv": "^17.3.1",
2122
"prism-react-renderer": "^2.3.0",
2223
"react": "^18.0.0",
2324
"react-dom": "^18.0.0"

0 commit comments

Comments
 (0)