Skip to content

Commit 69fe30f

Browse files
committed
add env var PLAUSIBLE_DOMAIN and set it for every mirror
1 parent cbe64aa commit 69fe30f

17 files changed

+70
-14
lines changed

.env.development.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ SITE_URL=http://localhost:3000
66
# always true in development, set only on prod build
77
# PREVIEW_MODE=
88

9-
# plausible analytics url
9+
# Plausible analytics url
1010
PLAUSIBLE_SCRIPT_URL=
11+
12+
# for mirrors, hostname set in Plausible dashboard
13+
# if not set, defaults to SITE_URL without https://
14+
PLAUSIBLE_DOMAIN=

.env.production.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ PREVIEW_MODE=
1010

1111
# plausible analytics url
1212
PLAUSIBLE_SCRIPT_URL=
13+
14+
# for mirrors, hostname set in Plausible dashboard
15+
# if not set, defaults to SITE_URL without https://
16+
PLAUSIBLE_DOMAIN=nemanjamitic.com

.github/workflows/bash__deploy-nginx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Deploy Nginx with bash file
22

33
on:
44
push:
5+
# this one is enabled
56
branches:
67
- 'main'
78
tags:
@@ -15,6 +16,8 @@ env:
1516
SITE_URL: 'https://nemanjamitic.com'
1617
PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
1718
SSH_ALIAS: arm1
19+
# can be omitted for main domain, will default to SITE_URL
20+
# PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
1821

1922
jobs:
2023
deploy:

.github/workflows/default__build-push-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
SITE_URL_ARM64: 'https://nmc-docker.arm1.nemanjamitic.com'
1717
SITE_URL_AMD64: 'https://nmc-docker.local.nemanjamitic.com'
1818
PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
19+
PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
1920

2021
jobs:
2122
build:
@@ -87,6 +88,7 @@ jobs:
8788
build-args: |
8889
"ARG_SITE_URL=${{ env.SITE_URL }}"
8990
"ARG_PLAUSIBLE_SCRIPT_URL=${{ env.PLAUSIBLE_SCRIPT_URL }}"
91+
"ARG_PLAUSIBLE_DOMAIN=${{ env.PLAUSIBLE_DOMAIN }}"
9092
push: true
9193
tags: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest
9294
# disabled metadata step

.github/workflows/default__deploy-nginx.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
env:
1515
SITE_URL: 'https://nemanjamitic.com'
1616
PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
17+
PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
1718

1819
jobs:
1920
deploy:

.github/workflows/gh-pages__deploy-astro.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ permissions:
2424
env:
2525
SITE_URL: 'https://nemanjam.github.io'
2626
PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
27+
PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
2728

2829
jobs:
2930
# build with astro action, unusable for monorepo

.github/workflows/gh-pages__deploy-manual.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ permissions:
2121
env:
2222
SITE_URL: 'https://nemanjam.github.io'
2323
PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
24+
PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
2425

2526
jobs:
2627
build-manual:

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
ARG_SITE_URL: 'http://localhost:8080'
1414
# make separate script with localhost enabled
1515
ARG_PLAUSIBLE_SCRIPT_URL: 'https://plausible.arm1.nemanjamitic.com/js/script.js'
16+
# will trigger analytics
17+
ARG_PLAUSIBLE_DOMAIN: 'nemanjamitic.com'
1618

1719
# platform: linux/arm64
1820
platform: linux/amd64

docker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ ARG ARG_PLAUSIBLE_SCRIPT_URL
2929
ENV PLAUSIBLE_SCRIPT_URL=$ARG_PLAUSIBLE_SCRIPT_URL
3030
RUN echo "PLAUSIBLE_SCRIPT_URL=$PLAUSIBLE_SCRIPT_URL"
3131

32+
ARG ARG_PLAUSIBLE_DOMAIN
33+
ENV PLAUSIBLE_DOMAIN=$ARG_PLAUSIBLE_DOMAIN
34+
RUN echo "PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN"
35+
3236
RUN yarn build
3337

3438
FROM nginx:stable-alpine3.17-slim AS runtime

docs/working-notes/todo3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,5 +550,6 @@ restructure folders, folder name, mdx and images in same folder
550550
content collections to content layer
551551
fix plausible for all subdomains
552552
gallery astro image
553+
prettyPrintObject in_ dev works after page load, ok
553554
------------
554555
```

0 commit comments

Comments
 (0)