File tree Expand file tree Collapse file tree 4 files changed +30
-6
lines changed Expand file tree Collapse file tree 4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 11
11
{% endif %}
12
12
13
13
< script defer data-domain ="studentrobotics.org " src ="https://plausible.io/js/plausible.js "> </ script >
14
+ < script > window . plausible = window . plausible || function ( ) { ( window . plausible . q = window . plausible . q || [ ] ) . push ( arguments ) } </ script >
14
15
15
16
< script src ="{{ '/js/navigation.js' | prepend: site.baseurl }} "> </ script >
Original file line number Diff line number Diff line change @@ -17,25 +17,30 @@ <h1>Documentation</h1>
17
17
< div class ="column m-9-12 doc ">
18
18
{{ content }}
19
19
20
- < table >
20
+ < table id =" updates-table " >
21
21
< tr >
22
22
< th > </ th >
23
23
< th > Release Date</ th >
24
24
< th > Download</ th >
25
25
< th > Licences</ th >
26
26
</ tr >
27
27
{% for kit_version in site.data.kit_versions %}
28
- < tr id ="{{ kit_version.version | slugify }} ">
28
+ {% assign version = kit_version.version %}
29
+ < tr id ="{{ version | slugify }} ">
29
30
< td >
30
31
{% if forloop.first %}
31
- < code > < strong > {{ kit_version. version }}</ strong > </ code >
32
+ < code > < strong > {{ version }}</ strong > </ code >
32
33
{% else %}
33
- < code > {{ kit_version. version }}</ code >
34
+ < code > {{ version }}</ code >
34
35
{% endif %}
35
36
</ td >
36
37
< td > {{ kit_version.released | date_to_string }}</ td >
37
- < td > < a href ="https://kit-downloads.studentrobotics.org/kit-software/{{ kit_version.version }}/srobo-robot-{{ kit_version.version }}.img.xz "> Download < code > {{ kit_version.version }}</ code > </ a > </ td >
38
- < td > < a href ="https://kit-downloads.studentrobotics.org/kit-software/{{ kit_version.version }}/srobo-robot-{{ kit_version.version }}-licences "> Licences</ a > </ td >
38
+ < td >
39
+ < a class ="kit-download-link " data-version ="{{ version }} " href ="https://kit-downloads.studentrobotics.org/kit-software/{{ version }}/srobo-robot-{{ version }}.img.xz ">
40
+ Download {{ version }}
41
+ </ a >
42
+ </ td >
43
+ < td > < a href ="https://kit-downloads.studentrobotics.org/kit-software/{{ version }}/srobo-robot-{{ version }}-licences "> Licences</ a > </ td >
39
44
</ tr >
40
45
{% endfor %}
41
46
</ table >
Original file line number Diff line number Diff line change
1
+ function handleDownloadClick ( event ) {
2
+ plausible ( "Kit download" , { props : { version : event . target . dataset . version } } ) ;
3
+
4
+ // Delay navigation so that Plausible is notified of the click
5
+ setTimeout ( function ( ) {
6
+ location . href = event . target . href ;
7
+ } , 150 ) ;
8
+ event . preventDefault ( ) ;
9
+ }
10
+
11
+ function addDownloadTracking ( ) {
12
+ document . querySelectorAll ( "#updates-table .kit-download-link" ) . forEach ( function ( link ) {
13
+ link . addEventListener ( "click" , handleDownloadClick ) ;
14
+ } ) ;
15
+ }
16
+
17
+ window . addEventListener ( 'load' , addDownloadTracking ) ;
Original file line number Diff line number Diff line change 1
1
---
2
2
layout : updates
3
3
title : Updates
4
+ extra_js : updates
4
5
---
5
6
6
7
# Updates
You can’t perform that action at this time.
0 commit comments