Compare commits
10 Commits
ba2b3af650
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
8baf017171
|
|||
|
d3f6747116
|
|||
|
f08784598d
|
|||
|
9201cb6f23
|
|||
|
f9223c2852
|
|||
|
ebc7ebc229
|
|||
|
3130661e65
|
|||
|
9bc51ff408
|
|||
|
c39fae5ec5
|
|||
|
88e355aa98
|
@@ -7,14 +7,14 @@ when:
|
|||||||
- event: manual
|
- event: manual
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
install:
|
- name: install
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable
|
- corepack enable
|
||||||
- corepack prepare pnpm@latest --activate
|
- corepack prepare pnpm@latest --activate
|
||||||
- pnpm install --frozen-lockfile
|
- pnpm install --frozen-lockfile
|
||||||
|
|
||||||
lint:
|
- name: lint
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable && corepack prepare pnpm@latest --activate
|
- corepack enable && corepack prepare pnpm@latest --activate
|
||||||
@@ -22,7 +22,25 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- install
|
- install
|
||||||
|
|
||||||
check:
|
- name: Send Lint Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Lint failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: check
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable && corepack prepare pnpm@latest --activate
|
- corepack enable && corepack prepare pnpm@latest --activate
|
||||||
@@ -30,7 +48,25 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- lint
|
||||||
|
|
||||||
test:
|
- name: Send Svelte Check Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Svelte Check failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- check
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: Unit Tests
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable && corepack prepare pnpm@latest --activate
|
- corepack enable && corepack prepare pnpm@latest --activate
|
||||||
@@ -38,15 +74,51 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- check
|
- check
|
||||||
|
|
||||||
build:
|
- name: Send Test Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Test failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Unit Tests
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: build
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable && corepack prepare pnpm@latest --activate
|
- corepack enable && corepack prepare pnpm@latest --activate
|
||||||
- pnpm run build
|
- pnpm run build
|
||||||
depends_on:
|
depends_on:
|
||||||
- test
|
- Unit Tests
|
||||||
|
|
||||||
build-full:
|
- name: Send Build Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: build-full
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- apt-get update
|
- apt-get update
|
||||||
@@ -58,7 +130,25 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
e2e:
|
- name: Send Build Full Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build Full failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- build-full
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: E2E Tests
|
||||||
image: node:22-bookworm-slim
|
image: node:22-bookworm-slim
|
||||||
commands:
|
commands:
|
||||||
- corepack enable && corepack prepare pnpm@latest --activate
|
- corepack enable && corepack prepare pnpm@latest --activate
|
||||||
@@ -66,3 +156,45 @@ steps:
|
|||||||
- pnpm run test:e2e
|
- pnpm run test:e2e
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
|
- name: Send E2E Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] E2E failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- E2E Tests
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: Send CI Pipeline Status Notification (success)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_tests_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] CI pipeline success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- install
|
||||||
|
- lint
|
||||||
|
- check
|
||||||
|
- Unit Tests
|
||||||
|
- build
|
||||||
|
- build-full
|
||||||
|
- E2E Tests
|
||||||
|
when:
|
||||||
|
- status: [success]
|
||||||
|
|||||||
@@ -45,6 +45,42 @@ steps:
|
|||||||
echo "All build attempts failed"
|
echo "All build attempts failed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
- name: Send Docker Image Build Status Notification (success)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Docker image build
|
||||||
|
when:
|
||||||
|
- status: [success]
|
||||||
|
|
||||||
|
- name: Send Docker Image Build Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Docker image build
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
- name: Push to registry
|
- name: Push to registry
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -72,6 +108,42 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- Docker image build
|
- Docker image build
|
||||||
|
|
||||||
|
- name: Send Push to Registry Status Notification (success)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Push to registry
|
||||||
|
when:
|
||||||
|
- status: [success]
|
||||||
|
|
||||||
|
- name: Send Push to Registry Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Push to registry
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|
||||||
- name: Trigger Portainer stack redeploy
|
- name: Trigger Portainer stack redeploy
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -91,3 +163,39 @@ steps:
|
|||||||
echo "✓ Portainer redeploy triggered (HTTP $code)"
|
echo "✓ Portainer redeploy triggered (HTTP $code)"
|
||||||
depends_on:
|
depends_on:
|
||||||
- Push to registry
|
- Push to registry
|
||||||
|
|
||||||
|
- name: Send Deploy Status Notification (success)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Trigger Portainer stack redeploy
|
||||||
|
when:
|
||||||
|
- status: [success]
|
||||||
|
|
||||||
|
- name: Send Deploy Status Notification (failure)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
MATTERMOST_CHANNEL_ID:
|
||||||
|
from_secret: mattermost_pushes_channel_id
|
||||||
|
MATTERMOST_POST_API_URL:
|
||||||
|
from_secret: mattermost_post_api_url
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
|
||||||
|
depends_on:
|
||||||
|
- Trigger Portainer stack redeploy
|
||||||
|
when:
|
||||||
|
- status: [failure]
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ services:
|
|||||||
- 'traefik.http.routers.mifi-dev.rule=Host(`mifi.dev`) || Host(`www.mifi.dev`)'
|
- 'traefik.http.routers.mifi-dev.rule=Host(`mifi.dev`) || Host(`www.mifi.dev`)'
|
||||||
- 'traefik.http.routers.mifi-dev.entrypoints=websecure'
|
- 'traefik.http.routers.mifi-dev.entrypoints=websecure'
|
||||||
- 'traefik.http.routers.mifi-dev.service=mifi-dev'
|
- 'traefik.http.routers.mifi-dev.service=mifi-dev'
|
||||||
- 'traefik.http.routers.mifi-dev.middlewares=security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
- 'traefik.http.routers.mifi-dev.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||||
- 'traefik.http.routers.mifi-dev.tls=true'
|
- 'traefik.http.routers.mifi-dev.tls=true'
|
||||||
- 'traefik.http.routers.mifi-dev.tls.certresolver=letsencrypt'
|
- 'traefik.http.routers.mifi-dev.tls.certresolver=letsencrypt'
|
||||||
- 'traefik.http.services.mifi-dev.loadbalancer.server.port=80'
|
- 'traefik.http.services.mifi-dev.loadbalancer.server.port=80'
|
||||||
@@ -25,7 +25,7 @@ services:
|
|||||||
- 'traefik.http.routers.mifi-bio.rule=Host(`mifi.bio`) || Host(`www.mifi.bio`)'
|
- 'traefik.http.routers.mifi-bio.rule=Host(`mifi.bio`) || Host(`www.mifi.bio`)'
|
||||||
- 'traefik.http.routers.mifi-bio.entrypoints=websecure'
|
- 'traefik.http.routers.mifi-bio.entrypoints=websecure'
|
||||||
- 'traefik.http.routers.mifi-bio.service=mifi-bio'
|
- 'traefik.http.routers.mifi-bio.service=mifi-bio'
|
||||||
- 'traefik.http.routers.mifi-bio.middlewares=security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
- 'traefik.http.routers.mifi-bio.middlewares=gzip@file,security-supermax-with-analytics@file,redirect-www-to-non-www@file'
|
||||||
- 'traefik.http.routers.mifi-bio.tls=true'
|
- 'traefik.http.routers.mifi-bio.tls=true'
|
||||||
- 'traefik.http.routers.mifi-bio.tls.certresolver=letsencrypt'
|
- 'traefik.http.routers.mifi-bio.tls.certresolver=letsencrypt'
|
||||||
- 'traefik.http.services.mifi-bio.loadbalancer.server.port=80'
|
- 'traefik.http.services.mifi-bio.loadbalancer.server.port=80'
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
"build": "vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build": "vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
||||||
"build:bio": "CONTENT_VARIANT=bio vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build:bio": "CONTENT_VARIANT=bio vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
||||||
"build:dev": "CONTENT_VARIANT=dev vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build:dev": "CONTENT_VARIANT=dev vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
||||||
"build:full": "vite build && pnpm run critical-css && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build:full": "vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs && pnpm run critical-css",
|
||||||
"build:full:bio": "CONTENT_VARIANT=bio vite build && pnpm run critical-css && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build:full:bio": "CONTENT_VARIANT=bio vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs && pnpm run critical-css",
|
||||||
"build:full:dev": "CONTENT_VARIANT=dev vite build && pnpm run critical-css && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs",
|
"build:full:dev": "CONTENT_VARIANT=dev vite build && node scripts/minify-static-assets.mjs && node scripts/externalize-inline-script.mjs && pnpm run critical-css",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lucide/svelte": "^0.563.1"
|
"@lucide/svelte": "^0.563.1"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.28.2",
|
"packageManager": "pnpm@10.29.1+sha512.48dae233635a645768a3028d19545cacc1688639eeb1f3734e42d6d6b971afbf22aa1ac9af52a173d9c3a20c15857cfa400f19994d79a2f626fcc73fccda9bbc",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.mifi.dev/mifi-holdings/mifi-links.git"
|
"url": "https://git.mifi.dev/mifi-holdings/mifi-links.git"
|
||||||
|
|||||||
@@ -6,23 +6,57 @@
|
|||||||
* Usage: node scripts/critical-css.mjs [buildDir]
|
* Usage: node scripts/critical-css.mjs [buildDir]
|
||||||
* buildDir: path to build output (default: "build"). Use from repo root.
|
* buildDir: path to build output (default: "build"). Use from repo root.
|
||||||
*/
|
*/
|
||||||
import { readFileSync, writeFileSync } from 'node:fs';
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
|
import { homedir, platform } from 'node:os';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { cwd } from 'node:process';
|
import { cwd } from 'node:process';
|
||||||
|
|
||||||
const buildDir = join(cwd(), process.argv[2] || 'build');
|
const buildDir = join(cwd(), process.argv[2] || 'build');
|
||||||
const htmlPath = join(buildDir, 'index.html');
|
const htmlPath = join(buildDir, 'index.html');
|
||||||
|
|
||||||
// critical/penthouse use a nested puppeteer; point it at our installed Chrome
|
// critical/penthouse use a nested puppeteer; point at an installed Chrome/Chromium.
|
||||||
try {
|
// Only set PUPPETEER_EXECUTABLE_PATH if the path exists. Prefer Playwright's Chromium
|
||||||
const puppeteer = await import('puppeteer');
|
// on arm64 so we use the native binary (Puppeteer's default can be x86 on ARM hosts e.g. OrbStack).
|
||||||
const executablePath = puppeteer.default?.executablePath?.();
|
function getPlaywrightChromePath() {
|
||||||
if (executablePath) {
|
const cacheBase =
|
||||||
process.env.PUPPETEER_EXECUTABLE_PATH = executablePath;
|
process.env.PLAYWRIGHT_BROWSERS_PATH || join(homedir(), '.cache', 'ms-playwright');
|
||||||
|
if (!existsSync(cacheBase)) return null;
|
||||||
|
const dirs = readdirSync(cacheBase, { withFileTypes: true });
|
||||||
|
for (const d of dirs) {
|
||||||
|
if (!d.isDirectory() || !d.name.startsWith('chromium-')) continue;
|
||||||
|
const sub = join(cacheBase, d.name);
|
||||||
|
const rel =
|
||||||
|
platform() === 'win32'
|
||||||
|
? 'chrome-win\\chrome.exe'
|
||||||
|
: platform() === 'darwin'
|
||||||
|
? 'chrome-mac/Chromium.app/Contents/MacOS/Chromium'
|
||||||
|
: 'chrome-linux/chrome';
|
||||||
|
const candidate = join(sub, rel);
|
||||||
|
if (existsSync(candidate)) return candidate;
|
||||||
}
|
}
|
||||||
} catch {
|
return null;
|
||||||
// no top-level puppeteer or no executable; rely on env or default
|
|
||||||
}
|
}
|
||||||
|
async function resolveChromePath() {
|
||||||
|
const isArm64 = process.arch === 'arm64';
|
||||||
|
if (isArm64) {
|
||||||
|
const pw = getPlaywrightChromePath();
|
||||||
|
if (pw) return pw;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const puppeteer = await import('puppeteer');
|
||||||
|
const path = puppeteer.default?.executablePath?.();
|
||||||
|
if (path && existsSync(path)) return path;
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
if (!isArm64) {
|
||||||
|
const pw = getPlaywrightChromePath();
|
||||||
|
if (pw) return pw;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const chromePath = await resolveChromePath();
|
||||||
|
if (chromePath) process.env.PUPPETEER_EXECUTABLE_PATH = chromePath;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { generate } = await import('critical');
|
const { generate } = await import('critical');
|
||||||
@@ -45,9 +79,16 @@ try {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = err instanceof Error ? err.message : String(err);
|
const msg = err instanceof Error ? err.message : String(err);
|
||||||
console.error('Critical CSS step failed:', msg);
|
console.error('Critical CSS step failed:', msg);
|
||||||
if (msg.includes('Browser is not downloaded')) {
|
if (
|
||||||
|
msg.includes('Browser is not downloaded') ||
|
||||||
|
msg.includes('did not find any executable') ||
|
||||||
|
msg.includes('Could not find Chrome')
|
||||||
|
) {
|
||||||
console.error('Install Chromium first: pnpm run critical-css:install');
|
console.error('Install Chromium first: pnpm run critical-css:install');
|
||||||
console.error('Or run "pnpm run build" without critical CSS.');
|
console.error(
|
||||||
|
'(Dev container: Playwright Chromium is also used if present in ~/.cache/ms-playwright.)',
|
||||||
|
);
|
||||||
|
console.error('Or run "pnpm run build" (without critical CSS) for a working build.');
|
||||||
}
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Post-build: minify JS and CSS under build/assets (files copied from static/).
|
* Post-build: minify JS and CSS under build/assets (files copied from static/).
|
||||||
|
* Includes static/assets/js/*.js (e.g. ga-init.js, bootstrap.js) and assets/*.css.
|
||||||
* Usage: node scripts/minify-static-assets.mjs [buildDir]
|
* Usage: node scripts/minify-static-assets.mjs [buildDir]
|
||||||
*/
|
*/
|
||||||
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
|
|||||||
@@ -3,10 +3,19 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
<script src="/assets/js/bootstrap.js"></script>
|
<script src="/assets/js/bootstrap.js"></script>
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover">
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
<img
|
||||||
|
src="https://analytics.mifi.holdings/pixel.gif"
|
||||||
|
alt=""
|
||||||
|
width="1"
|
||||||
|
height="1"
|
||||||
|
role="presentation"
|
||||||
|
loading="eager"
|
||||||
|
/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
aria-describedby={link.description ? descriptionId : undefined}
|
aria-describedby={link.description ? descriptionId : undefined}
|
||||||
|
data-umami-event={`contact panel ${link.label} link`}
|
||||||
>
|
>
|
||||||
{#if link.icon}
|
{#if link.icon}
|
||||||
<LinkIcon href={link.href} icon={link.icon} label={link.label} />
|
<LinkIcon href={link.href} icon={link.icon} label={link.label} />
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
color: var(--color-secondary-muted);
|
color: var(--color-secondary-muted);
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 1rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
contactOpen = true;
|
contactOpen = true;
|
||||||
shareOpen = false;
|
shareOpen = false;
|
||||||
}}
|
}}
|
||||||
|
data-umami-event="header contact button"
|
||||||
>
|
>
|
||||||
<IconContact size={20} />
|
<IconContact size={20} />
|
||||||
</button>
|
</button>
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
shareOpen = true;
|
shareOpen = true;
|
||||||
contactOpen = false;
|
contactOpen = false;
|
||||||
}}
|
}}
|
||||||
|
data-umami-event="header share button"
|
||||||
>
|
>
|
||||||
<IconShare size={20} />
|
<IconShare size={20} />
|
||||||
</button>
|
</button>
|
||||||
@@ -98,6 +100,7 @@
|
|||||||
contactOpen = true;
|
contactOpen = true;
|
||||||
shareOpen = false;
|
shareOpen = false;
|
||||||
}}
|
}}
|
||||||
|
data-umami-event="hero contact button"
|
||||||
>
|
>
|
||||||
<IconContact size={20} />
|
<IconContact size={20} />
|
||||||
<span>Contact</span>
|
<span>Contact</span>
|
||||||
@@ -111,6 +114,7 @@
|
|||||||
shareOpen = true;
|
shareOpen = true;
|
||||||
contactOpen = false;
|
contactOpen = false;
|
||||||
}}
|
}}
|
||||||
|
data-umami-event="hero share button"
|
||||||
>
|
>
|
||||||
<IconShare size={20} />
|
<IconShare size={20} />
|
||||||
<span>Share</span>
|
<span>Share</span>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
let { href, icon, label, description }: ProcessedLink = $props();
|
let { href, icon, label, description }: ProcessedLink = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a {href} rel="noopener noreferrer" target="_blank" class="link">
|
<a {href} rel="noopener noreferrer" target="_blank" class="link" data-umami-event={`${label} link`}>
|
||||||
<span class="icon" aria-hidden="true">
|
<span class="icon" aria-hidden="true">
|
||||||
<LinkIcon {href} {icon} {label} />
|
<LinkIcon {href} {icon} {label} />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { Snippet } from 'svelte';
|
||||||
import type { Component } from 'svelte';
|
import type { Component } from 'svelte';
|
||||||
import { tick } from 'svelte';
|
import { tick } from 'svelte';
|
||||||
|
|
||||||
@@ -9,7 +10,7 @@
|
|||||||
open = false,
|
open = false,
|
||||||
title = '',
|
title = '',
|
||||||
}: {
|
}: {
|
||||||
children: import('svelte').Snippet;
|
children: Snippet;
|
||||||
icon?: Component<{ size?: number }>;
|
icon?: Component<{ size?: number }>;
|
||||||
onclose: () => void;
|
onclose: () => void;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -41,6 +42,9 @@
|
|||||||
aria-labelledby="panel-title"
|
aria-labelledby="panel-title"
|
||||||
aria-modal="true"
|
aria-modal="true"
|
||||||
onclose={handleDialogClose}
|
onclose={handleDialogClose}
|
||||||
|
onclick={(e) => {
|
||||||
|
if (e.target === dialogEl) onclose();
|
||||||
|
}}
|
||||||
oncancel={(e) => {
|
oncancel={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
onclose();
|
onclose();
|
||||||
@@ -105,7 +109,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
display: flex;
|
display: flex;
|
||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
padding-bottom: 2rem;
|
padding-bottom: 1rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -50,14 +50,19 @@
|
|||||||
{#if qrCodeImage}
|
{#if qrCodeImage}
|
||||||
<div class="share-qr">
|
<div class="share-qr">
|
||||||
<img
|
<img
|
||||||
src="/assets/images/{qrCodeImage}.png"
|
src="/assets/images/{qrCodeImage}.svg"
|
||||||
alt="QR code for this page"
|
alt="QR code for this page"
|
||||||
width="160"
|
width="160"
|
||||||
height="160"
|
height="160"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<button type="button" class="panel-btn" onclick={copyLink}>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="panel-btn"
|
||||||
|
onclick={copyLink}
|
||||||
|
data-umami-event="share panel copy"
|
||||||
|
>
|
||||||
<IconCopy size={20} />
|
<IconCopy size={20} />
|
||||||
{copied ? 'Copied!' : 'Copy link'}
|
{copied ? 'Copied!' : 'Copy link'}
|
||||||
</button>
|
</button>
|
||||||
@@ -67,12 +72,18 @@
|
|||||||
onclick={onclose}
|
onclick={onclose}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
|
data-umami-event="share panel email link"
|
||||||
>
|
>
|
||||||
<IconEmail size={20} />
|
<IconEmail size={20} />
|
||||||
Email link
|
Email link
|
||||||
</a>
|
</a>
|
||||||
{#if canShare}
|
{#if canShare}
|
||||||
<button type="button" class="panel-btn" onclick={share}>
|
<button
|
||||||
|
type="button"
|
||||||
|
class="panel-btn"
|
||||||
|
onclick={share}
|
||||||
|
data-umami-event="share panel device share"
|
||||||
|
>
|
||||||
<IconShare size={20} />
|
<IconShare size={20} />
|
||||||
Share…
|
Share…
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
aria-label="Close theme menu"
|
aria-label="Close theme menu"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
onclick={() => (expanded = false)}
|
onclick={() => (expanded = false)}
|
||||||
|
data-umami-event="theme toggle close"
|
||||||
></button>
|
></button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@
|
|||||||
aria-current={current === 'light' ? 'true' : undefined}
|
aria-current={current === 'light' ? 'true' : undefined}
|
||||||
title="Light"
|
title="Light"
|
||||||
onclick={() => handleClick('light')}
|
onclick={() => handleClick('light')}
|
||||||
|
data-umami-event="theme toggle light"
|
||||||
>
|
>
|
||||||
<Sun size={24} />
|
<Sun size={24} />
|
||||||
</button>
|
</button>
|
||||||
@@ -75,6 +77,7 @@
|
|||||||
aria-current={current === 'dark' ? 'true' : undefined}
|
aria-current={current === 'dark' ? 'true' : undefined}
|
||||||
title="Dark"
|
title="Dark"
|
||||||
onclick={() => handleClick('dark')}
|
onclick={() => handleClick('dark')}
|
||||||
|
data-umami-event="theme toggle dark"
|
||||||
>
|
>
|
||||||
<Moon size={24} />
|
<Moon size={24} />
|
||||||
</button>
|
</button>
|
||||||
@@ -86,6 +89,7 @@
|
|||||||
aria-current={current === 'auto' ? 'true' : undefined}
|
aria-current={current === 'auto' ? 'true' : undefined}
|
||||||
title="Auto (system)"
|
title="Auto (system)"
|
||||||
onclick={() => handleClick('auto')}
|
onclick={() => handleClick('auto')}
|
||||||
|
data-umami-event="theme toggle auto"
|
||||||
>
|
>
|
||||||
<SunMoon size={24} />
|
<SunMoon size={24} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
* App config: own-property hostnames for UTM attribution, variant hostnames, GA IDs.
|
* App config: own-property hostnames for UTM attribution, variant hostnames, GA IDs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { ContentVariant } from './data/constants';
|
||||||
|
|
||||||
export const OWN_PROPERTY_HOSTS = [
|
export const OWN_PROPERTY_HOSTS = [
|
||||||
'mifi.ventures',
|
'mifi.ventures',
|
||||||
'cal.mifi.ventures',
|
'cal.mifi.ventures',
|
||||||
@@ -9,20 +11,25 @@ export const OWN_PROPERTY_HOSTS = [
|
|||||||
'mifi.bio',
|
'mifi.bio',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const VARIANT_HOSTS: Record<'dev' | 'bio', string> = {
|
export const VARIANT_HOSTS: Record<ContentVariant, string> = {
|
||||||
dev: 'mifi.dev',
|
[ContentVariant.DEV]: 'mifi.dev',
|
||||||
bio: 'mifi.bio',
|
[ContentVariant.BIO]: 'mifi.bio',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GA_MEASUREMENT_IDS: Record<'dev' | 'bio', string> = {
|
export const GA_MEASUREMENT_IDS: Record<ContentVariant, string> = {
|
||||||
dev: 'G-P8V832WDM8',
|
[ContentVariant.DEV]: 'G-P8V832WDM8',
|
||||||
bio: 'G-885B0KYWZ1',
|
[ContentVariant.BIO]: 'G-885B0KYWZ1',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const UMAMI_MEASUREMENT_IDS: Record<ContentVariant, string> = {
|
||||||
|
[ContentVariant.DEV]: 'ac7e751b-4ce3-49f2-80e0-f430b292b72a',
|
||||||
|
[ContentVariant.BIO]: 'cf44669d-10c1-4982-ad79-282aed4237e5',
|
||||||
};
|
};
|
||||||
|
|
||||||
/** theme-color meta values per variant (match tokens-{variant}.css --color-bg) */
|
/** theme-color meta values per variant (match tokens-{variant}.css --color-bg) */
|
||||||
export const THEME_COLORS: Record<'dev' | 'bio', { light: string; dark: string }> = {
|
export const THEME_COLORS: Record<ContentVariant, { light: string; dark: string }> = {
|
||||||
dev: { light: '#f5f4f8', dark: '#131118' }, // hsl(260 20% 98%) / hsl(260 18% 8%)
|
[ContentVariant.DEV]: { light: '#f5f4f8', dark: '#131118' }, // hsl(260 20% 98%) / hsl(260 18% 8%)
|
||||||
bio: { light: '#f4f6f9', dark: '#111318' }, // hsl(220 22% 98%) / hsl(220 18% 8%)
|
[ContentVariant.BIO]: { light: '#f4f6f9', dark: '#111318' }, // hsl(220 22% 98%) / hsl(220 18% 8%)
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UTM_MEDIUM = 'link';
|
export const UTM_MEDIUM = 'link';
|
||||||
|
|||||||
@@ -20,8 +20,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"linksHeading": "Professional Links and Profiles",
|
"linksHeading": "Professional Links and Profiles",
|
||||||
"showContact": true,
|
"qrCodeImage": "qr-mifi-dev"
|
||||||
"qrCodeImage": null
|
|
||||||
},
|
},
|
||||||
"bio": {
|
"bio": {
|
||||||
"title": "mifi.bio — the homepage of the human Mike Fitzpatrick",
|
"title": "mifi.bio — the homepage of the human Mike Fitzpatrick",
|
||||||
@@ -51,8 +50,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"linksHeading": "Links and Profiles",
|
"linksHeading": "Links and Profiles",
|
||||||
"showContact": false,
|
"qrCodeImage": "qr-mifi-bio"
|
||||||
"qrCodeImage": null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contactLinks": [
|
"contactLinks": [
|
||||||
@@ -124,6 +122,14 @@
|
|||||||
"dev": 1
|
"dev": 1
|
||||||
},
|
},
|
||||||
"links": [
|
"links": [
|
||||||
|
{
|
||||||
|
"href": "https://mifi.dev/downloads/resume-2026lf.pdf",
|
||||||
|
"icon": "Resume",
|
||||||
|
"label": "Long-form CV",
|
||||||
|
"description": "My full resume, including all my work experience, education, and skills.",
|
||||||
|
"utmContent": "resume-lf",
|
||||||
|
"variants": ["dev", "bio"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"href": "https://mifi.dev/downloads/resume-2026c.pdf",
|
"href": "https://mifi.dev/downloads/resume-2026c.pdf",
|
||||||
"icon": "Resume",
|
"icon": "Resume",
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ export interface Site {
|
|||||||
sameAs: string[];
|
sameAs: string[];
|
||||||
};
|
};
|
||||||
linksHeading?: string;
|
linksHeading?: string;
|
||||||
/** If false, hide Contact button and panel for this variant. Default true. */
|
|
||||||
showContact?: boolean;
|
|
||||||
/** Contact panel links; if omitted, first section links are used. */
|
|
||||||
contactLinks?: ContactLink[];
|
contactLinks?: ContactLink[];
|
||||||
/** Optional QR code image path (e.g. /assets/images/qr-mifi-dev.png) for Share panel. */
|
|
||||||
qrCodeImage?: string | null;
|
qrCodeImage?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import contentData from '$lib/data/links.json';
|
import contentData from '$lib/data/links.json';
|
||||||
import { VARIANT_HOSTS, GA_MEASUREMENT_IDS, THEME_COLORS } from '$lib/config';
|
import {
|
||||||
|
VARIANT_HOSTS,
|
||||||
|
GA_MEASUREMENT_IDS,
|
||||||
|
THEME_COLORS,
|
||||||
|
UMAMI_MEASUREMENT_IDS,
|
||||||
|
} from '$lib/config';
|
||||||
import type { Site, ContentData, ProcessedLink } from '$lib/data/types';
|
import type { Site, ContentData, ProcessedLink } from '$lib/data/types';
|
||||||
import type { LayoutServerLoad } from './$types';
|
import type { LayoutServerLoad } from './$types';
|
||||||
import { ContentVariant, HeroLayout } from '$lib/data/constants';
|
import { ContentVariant, HeroLayout } from '$lib/data/constants';
|
||||||
@@ -18,6 +23,7 @@ export type LayoutServerDataOut = {
|
|||||||
};
|
};
|
||||||
variant: string;
|
variant: string;
|
||||||
gaMeasurementId: string;
|
gaMeasurementId: string;
|
||||||
|
umamiMeasurementId: string;
|
||||||
/** theme-color meta values for current variant */
|
/** theme-color meta values for current variant */
|
||||||
themeColorLight: string;
|
themeColorLight: string;
|
||||||
themeColorDark: string;
|
themeColorDark: string;
|
||||||
@@ -57,7 +63,6 @@ export const load: LayoutServerLoad<LayoutServerDataOut> = (): LayoutServerDataO
|
|||||||
location: siteDef?.location,
|
location: siteDef?.location,
|
||||||
person: siteDef?.person,
|
person: siteDef?.person,
|
||||||
linksHeading: siteDef?.linksHeading,
|
linksHeading: siteDef?.linksHeading,
|
||||||
showContact: siteDef?.showContact,
|
|
||||||
contactLinks: siteDef?.contactLinks,
|
contactLinks: siteDef?.contactLinks,
|
||||||
qrCodeImage: siteDef?.qrCodeImage ?? undefined,
|
qrCodeImage: siteDef?.qrCodeImage ?? undefined,
|
||||||
};
|
};
|
||||||
@@ -68,6 +73,7 @@ export const load: LayoutServerLoad<LayoutServerDataOut> = (): LayoutServerDataO
|
|||||||
links: { sections },
|
links: { sections },
|
||||||
variant,
|
variant,
|
||||||
gaMeasurementId: GA_MEASUREMENT_IDS[variant],
|
gaMeasurementId: GA_MEASUREMENT_IDS[variant],
|
||||||
|
umamiMeasurementId: UMAMI_MEASUREMENT_IDS[variant],
|
||||||
themeColorLight: themeColors.light,
|
themeColorLight: themeColors.light,
|
||||||
themeColorDark: themeColors.dark,
|
themeColorDark: themeColors.dark,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
<!-- Google tag (gtag.js): ID passed via data-ga-id for CSP (no inline script) -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id={data.gaMeasurementId}"></script>
|
||||||
|
<script defer src="/assets/js/ga-init.js" data-ga-id={data.gaMeasurementId}></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/assets/tokens-{data.variant}.css" />
|
<link rel="stylesheet" href="/assets/tokens-{data.variant}.css" />
|
||||||
|
|
||||||
<link
|
<link
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||||
import { load } from '../+layout.server';
|
import { load } from '../+layout.server';
|
||||||
|
import { UMAMI_MEASUREMENT_IDS } from '$lib/config';
|
||||||
import { ContentVariant } from '$lib/data/constants';
|
import { ContentVariant } from '$lib/data/constants';
|
||||||
import type { ContentData } from '$lib/data/types';
|
import type { ContentData } from '$lib/data/types';
|
||||||
|
|
||||||
@@ -95,7 +96,9 @@ describe('+layout.server', () => {
|
|||||||
it('gaMeasurementId matches variant', () => {
|
it('gaMeasurementId matches variant', () => {
|
||||||
process.env.CONTENT_VARIANT = ContentVariant.DEV;
|
process.env.CONTENT_VARIANT = ContentVariant.DEV;
|
||||||
expect(load().gaMeasurementId).toMatch(/^G-/);
|
expect(load().gaMeasurementId).toMatch(/^G-/);
|
||||||
|
expect(load().umamiMeasurementId).toBe(UMAMI_MEASUREMENT_IDS[ContentVariant.DEV]);
|
||||||
process.env.CONTENT_VARIANT = ContentVariant.BIO;
|
process.env.CONTENT_VARIANT = ContentVariant.BIO;
|
||||||
expect(load().gaMeasurementId).toMatch(/^G-/);
|
expect(load().gaMeasurementId).toMatch(/^G-/);
|
||||||
|
expect(load().umamiMeasurementId).toBe(UMAMI_MEASUREMENT_IDS[ContentVariant.BIO]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ describe('+layout (LayoutData)', () => {
|
|||||||
links: { sections: [] },
|
links: { sections: [] },
|
||||||
variant: 'dev',
|
variant: 'dev',
|
||||||
gaMeasurementId: 'G-xxx',
|
gaMeasurementId: 'G-xxx',
|
||||||
|
umamiMeasurementId: 'UM-xxx',
|
||||||
};
|
};
|
||||||
expect(mockData.site).toHaveProperty('title');
|
expect(mockData.site).toHaveProperty('title');
|
||||||
expect(mockData.site).toHaveProperty('url');
|
expect(mockData.site).toHaveProperty('url');
|
||||||
|
expect(mockData).toHaveProperty('umamiMeasurementId');
|
||||||
|
expect(mockData).toHaveProperty('gaMeasurementId');
|
||||||
expect(mockData).toHaveProperty('variant');
|
expect(mockData).toHaveProperty('variant');
|
||||||
expect(mockData.links).toHaveProperty('sections');
|
expect(mockData.links).toHaveProperty('sections');
|
||||||
});
|
});
|
||||||
|
|||||||
2
static/assets/images/qr-mifi-bio.svg
Normal file
2
static/assets/images/qr-mifi-bio.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.3 MiB |
2
static/assets/images/qr-mifi-dev.svg
Normal file
2
static/assets/images/qr-mifi-dev.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.0 MiB |
11
static/assets/js/ga-init.js
Normal file
11
static/assets/js/ga-init.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
(function () {
|
||||||
|
var script = document.currentScript;
|
||||||
|
var id = script && script.getAttribute('data-ga-id');
|
||||||
|
if (!id) return;
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag() {
|
||||||
|
window.dataLayer.push(arguments);
|
||||||
|
}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', id, { anonymize_ip: true });
|
||||||
|
})();
|
||||||
BIN
static/downloads/resume-2026c.pdf
Normal file
BIN
static/downloads/resume-2026c.pdf
Normal file
Binary file not shown.
BIN
static/downloads/resume-2026lf.pdf
Normal file
BIN
static/downloads/resume-2026lf.pdf
Normal file
Binary file not shown.
BIN
static/downloads/resume-2026p.pdf
Normal file
BIN
static/downloads/resume-2026p.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user