Skip to content

Commit 84be90a

Browse files
committed
Merged in feat/analytics (pull request #32)
adds fathom support, closes #66
2 parents 6454ef8 + ec4a3db commit 84be90a

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

vue/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VUE_APP_GRAPHQL_URI=http://www:8000/graphql/
22
VUE_APP_DJANGOBASEURL=http://www:8000
3+
VUE_APP_FATHOM_SITEID=GYFGUGON

vue/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VUE_APP_GRAPHQL_URI=/graphql/
22
VUE_APP_DJANGOBASEURL=
3+
VUE_APP_FATHOM_SITEID=

vue/src/App.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import LayoutDefault from '@/layouts/LayoutDefault.vue';
2020
2121
export default {
2222
data() {
23-
return {};
23+
return {
24+
fathomSiteId: process.env.VUE_APP_FATHOM_SITEID
25+
};
2426
},
2527
2628
created() {
@@ -36,6 +38,18 @@ export default {
3638
}
3739
},
3840
41+
mounted() {
42+
if (this.fathomSiteId !== '') {
43+
const fathomScript = document.createElement('script');
44+
fathomScript.setAttribute('src', 'https://cdn.usefathom.com/script.js');
45+
fathomScript.setAttribute('spa', 'auto');
46+
fathomScript.setAttribute('data-site', this.fathomSiteId);
47+
fathomScript.setAttribute('exluded-domains', 'www,www.local,localhost');
48+
fathomScript.setAttribute('defer', true);
49+
document.head.appendChild(fathomScript);
50+
}
51+
},
52+
3953
methods: {
4054
setInitialSnapshotnav() {
4155
if (this.$route.params.hash) {

vue/src/views/Home.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"h2.2": "Fallbeispiele",
1313
"p.3": "«Als Gemeindepräsident ist es mir wichtig, der Bevölkerung und dem Gemeinderat die Komplexität des Ortsplanungsprozesses und der Standortentwicklung verständlich und einfach zu übermitteln. Mit Hilfe von Daten und Visualisierungen über den Gemeindescan fällt es mir leichter, Lösungen und wichtige Entscheide zu fällen!»",
1414
"p.4": "Gemeindepräsident Wittenbach",
15+
"btn": "Mehr erfahren",
16+
"btn.href": "https:\/\/cividi.ch\/gemeindescan",
1517
"networkerror": "Die Gemeindesuche ist zur Zeit nicht verfügbar."
1618
},
1719
"fr": {
@@ -25,6 +27,8 @@
2527
"h2.2": "Examples",
2628
"p.3": "«En tant que maire, il est important pour moi de communiquer la complexité du processus de planification locale et du développement urbain à la population et au conseil municipal de manière simple et compréhensible. Avec l'aide des données et des visualisations via les analyses de la communauté, il m'est plus facile de trouver des solutions et de prendre des décisions importantes!»",
2729
"p.4": "Le maire de la municipalité Wittenbach",
30+
"btn": "En savoir plus",
31+
"btn.href": "https:\/\/cividi.ch\/gemeindescan-fr",
2832
"networkerror": "La recherche de communauté n'est pas disponible actuellement."
2933
}
3034
}
@@ -44,6 +48,14 @@
4448
<h1>{{ $t('h1.1') }}</h1>
4549
<p>{{ $t('p.1') }}</p>
4650
<p>{{ $t('p.2') }}</p>
51+
<p><br></p>
52+
<v-btn
53+
color="primary"
54+
elevation="2"
55+
x-large
56+
target="_blank"
57+
:href="$t('btn.href')"
58+
>{{ $t('btn') }}</v-btn>
4759
</v-col>
4860
</v-row>
4961
</v-container>

0 commit comments

Comments
 (0)