diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index 980dc99..1b0ef78 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -10,6 +10,7 @@ env:
DESCRIPTION: Documentation static site generator.
BASE: apos-docs
REPO: https://github.com/Apostolique/apos-docs/tree/main/
+ ANALYTICS: G-TK6SK1XJRV
jobs:
build:
@@ -28,7 +29,7 @@ jobs:
uses: c-hive/gha-npm-cache@v1
- name: Use apos-docs
run: |
- apos-docs -t ${{ env.TITLE }} -d '${{ env.DESCRIPTION }}' -b ${{ env.BASE }} -r ${{ env.REPO }}
+ apos-docs -t ${{ env.TITLE }} -d '${{ env.DESCRIPTION }}' -b ${{ env.BASE }} -r ${{ env.REPO }} -g ${{ env.ANALYTICS }}
cd apos-docs
npm install
npm run build
diff --git a/index.js b/index.js
index ecc9137..3468097 100644
--- a/index.js
+++ b/index.js
@@ -11,6 +11,7 @@ program
.option('-t, --title
', 'title for the project', 'Untitled')
.option('-d, --desc ', 'description for the project', 'No description.')
.option('-p, --path ', 'path to the markdown documentation files', 'docs')
+ .option('-a, --analytics ', 'code for your Google Analytics 4 property.')
.requiredOption('-b, --base ', 'base url for the relative links. For example: "apos-docs"')
.requiredOption('-r, --repo ', 'repo url for edit links. For example: "https://github.com/Apostolique/apos-docs/tree/main/"')
.parse();
@@ -43,5 +44,6 @@ fs.writeJsonSync('apos-docs/docs/_data/site.json', {
description: options.desc,
pathPrefix: options.base,
repo: options.repo,
- docs: options.path
+ docs: options.path,
+ analytics: options.analytics
})
diff --git a/src/_includes/default.njk b/src/_includes/default.njk
index 0d0bd60..c9e16eb 100644
--- a/src/_includes/default.njk
+++ b/src/_includes/default.njk
@@ -1,6 +1,14 @@
+ {% if site.analytics %}
+
+
+
+ {% endif %}
+