@gov-cy/govcy-frontend-renderer 1.14.3 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/package.json +1 -1
- package/src/njk/layouts/govcyBase.njk +20 -1
package/README.md
CHANGED
|
@@ -82,6 +82,10 @@ const inputData =
|
|
|
82
82
|
"headerTitle" : {"en":"Header title", "el":"Τιτλός επικεφαλιδας"},
|
|
83
83
|
"description" : {"en":"Service description", "el":"Περιγραφή υπηρεσίας"},
|
|
84
84
|
"url" : "https://gov.cy",
|
|
85
|
+
"matomo": {
|
|
86
|
+
"url": "//wp.matomo.dits.dmrid.gov.cy/",
|
|
87
|
+
"siteId": "1234"
|
|
88
|
+
},
|
|
85
89
|
"cdn" : {
|
|
86
90
|
"dist" : "https://cdn.jsdelivr.net/gh/gov-cy/govcy-design-system@3.0.0/dist",
|
|
87
91
|
"cssIntegrity" : "sha384-1zLHWOtnS0hOIz5mVEPZp0UH5gUE6eo0CQcCGA3sF2TyYhHyKOd3Ni8Iy/NjEASU",
|
|
@@ -171,6 +175,10 @@ const inputData =
|
|
|
171
175
|
"headerTitle" : {"en":"Header title", "el":"Τιτλός επικεφαλιδας"},
|
|
172
176
|
"description" : {"en":"Service description", "el":"Περιγραφή υπηρεσίας"},
|
|
173
177
|
"url" : "https://gov.cy",
|
|
178
|
+
"matomo": {
|
|
179
|
+
"url": "//wp.matomo.dits.dmrid.gov.cy/",
|
|
180
|
+
"siteId": "1234"
|
|
181
|
+
},
|
|
174
182
|
"cdn" : {
|
|
175
183
|
"dist" : "https://cdn.jsdelivr.net/gh/gov-cy/govcy-design-system@3.0.0/dist",
|
|
176
184
|
"cssIntegrity" : "sha384-1zLHWOtnS0hOIz5mVEPZp0UH5gUE6eo0CQcCGA3sF2TyYhHyKOd3Ni8Iy/NjEASU",
|
|
@@ -307,6 +315,7 @@ The `inputData` object has the following structure:
|
|
|
307
315
|
- **site.title**: the title of the site. It is used in the `<title>`, `<meta property="og:title"` and `<meta property="twitter:title"` tags of the head.
|
|
308
316
|
- **site.description**: the description of the site. It is used in the `<meta name="description"`, `<meta property="og:description"` and `<meta property="twitter:description"` tags of the head.
|
|
309
317
|
- **site.url**: the URL of the site. It is used in the `<meta property="og:url"` and `<meta property="twitter:url"` tags of the head.
|
|
318
|
+
- **site.matomo**: the matomo data. It is used to add the Matomo code to the page. If you don't want to use Matomo tracking, you can remove this value. Use `site.matomo.url` to define the URL of the Matomo server and `site.matomo.siteId` to define the site ID to be tracked.
|
|
310
319
|
- **site.cdn.dist**: the CDN of the site. It is used to define the URL of the CDN used for the CSS and JS files. If you need to change the version of the CDN, you can do it by changing this value (in this case you will need to change the `site.cdn.cssIntegrity` and `site.cdn.jsIntegrity` values as well)
|
|
311
320
|
- **site.cdn.cssIntegrity**: the integrity of the CSS file. It is used to define the integrity of the CSS file. If you need to change the version of the CDN, you will need to change this value. https://www.srihash.org/ can help you generate the integrity value.
|
|
312
321
|
- **site.cdn.jsIntegrity**: the integrity of the JS file. It is used to define the integrity of the JS file. If you need to change the version of the CDN, you will need to change this value. https://www.srihash.org/ can help you generate the integrity value.
|
package/package.json
CHANGED
|
@@ -22,6 +22,10 @@ To use this template you need to pass the following data:
|
|
|
22
22
|
"description" : {"en":"Service description", "el":"Περιγραφή υπηρεσίας"},
|
|
23
23
|
"isTesting" : true,
|
|
24
24
|
"url": "https://gov.cy",
|
|
25
|
+
"matomo": {
|
|
26
|
+
"url": "//wp.matomo.dits.dmrid.gov.cy/",
|
|
27
|
+
"siteId": 1234
|
|
28
|
+
},
|
|
25
29
|
"cdn": {
|
|
26
30
|
"dist": "https://cdn.jsdelivr.net/gh/gov-cy/govcy-design-system@3.0.0/dist",
|
|
27
31
|
"cssIntegrity": 'sha384-1zLHWOtnS0hOIz5mVEPZp0UH5gUE6eo0CQcCGA3sF2TyYhHyKOd3Ni8Iy/NjEASU",
|
|
@@ -76,7 +80,22 @@ To use this template you need to pass the following data:
|
|
|
76
80
|
|
|
77
81
|
<title>{% if pageData.title %}{{ govcyLocalizeContent(pageData.title, site.lang) }} - {% endif %}{% if site.title %}{{ govcyLocalizeContent(site.title, site.lang) }} - {% endif %}gov.cy</title>
|
|
78
82
|
<meta name="description" content="{{ govcyLocalizeContent(site.description, site.lang) }}">
|
|
79
|
-
|
|
83
|
+
{% if site.matomo and site.matomo.url and site.matomo.siteId %}
|
|
84
|
+
<!-- Matomo -->
|
|
85
|
+
<script>
|
|
86
|
+
var _paq = window._paq = window._paq || [];
|
|
87
|
+
_paq.push(['trackPageView']);
|
|
88
|
+
_paq.push(['enableLinkTracking']);
|
|
89
|
+
(function() {
|
|
90
|
+
var u="{{ site.matomo.url | safe }}";
|
|
91
|
+
_paq.push(['setTrackerUrl', u + '/matomo.php']);
|
|
92
|
+
_paq.push(['setSiteId', '{{ site.matomo.siteId | safe }}']);
|
|
93
|
+
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
|
94
|
+
g.async = true; g.src = u + '/matomo.js'; s.parentNode.insertBefore(g, s);
|
|
95
|
+
})();
|
|
96
|
+
</script>
|
|
97
|
+
<!-- End Matomo Code -->
|
|
98
|
+
{% endif %}
|
|
80
99
|
</head>
|
|
81
100
|
<body>
|
|
82
101
|
<!--bodyStart-->
|