Skip to content
Open
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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Google Analytics Tracking ID
# For local development, copy this file to `.env` and set your real tracking ID.
# For GitHub Actions, set `GA_TRACKING_ID` in repository variables (not secrets).
# Reference: Settings > Secrets and variables > Actions > Variables
# If deploying on Netlify, configure `GA_TRACKING_ID` in Netlify environment variables separately.
GA_TRACKING_ID=G-XXXXXXXXXX
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Docusaurus

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.14.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Docusaurus
run: yarn build
env:
GA_TRACKING_ID: ${{ vars.GA_TRACKING_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
10 changes: 6 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ const config = {
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
gtag: {
trackingID: "G-854W8PEZ1Z",
anonymizeIP: true,
},
...(process.env.GA_TRACKING_ID && {
Comment thread
mohitjeswani01 marked this conversation as resolved.
Comment thread
mohitjeswani01 marked this conversation as resolved.
gtag: {
trackingID: process.env.GA_TRACKING_ID,
anonymizeIP: true,
},
}),
Comment thread
mohitjeswani01 marked this conversation as resolved.
blog: {
showReadingTime: true,
feedOptions: {
Expand Down