Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update docs deploy

Leendert de Borstec87347fe6b1
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 6196d346a..99bb6b090 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -46,6 +46,8 @@ jobs:
- name: Build static site
working-directory: docs
+ env:
+ ANALYTICS_SCRIPT: '<script defer data-domain="docs.aliasvault.com" src="https://plausible.xivi.nl/js/script.js"></script>'
run: |
npm ci
npm run build
diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts
index a16efbe6d..a778a2223 100644
--- a/docs/docusaurus.config.ts
+++ b/docs/docusaurus.config.ts
@@ -2,6 +2,14 @@ import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
+try {
+ process.loadEnvFile();
+} catch {
+ // No `.env` file present; fall back to the ambient environment.
+}
+
+const analyticsScript = process.env.ANALYTICS_SCRIPT;
+
const config: Config = {
title: 'AliasVault',
tagline: 'A privacy-first password manager with built-in email aliasing',
@@ -221,6 +229,20 @@ const config: Config = {
},
},
],
+ // Inject the analytics <script> verbatim into <head>, but only when
+ // ANALYTICS_SCRIPT is provided (production CI build).
+ ...(analyticsScript
+ ? [
+ function analyticsPlugin() {
+ return {
+ name: 'analytics-script',
+ injectHtmlTags() {
+ return {headTags: analyticsScript};
+ },
+ };
+ },
+ ]
+ : []),
],
themes: [