Skip to content

Commit 869fa0e

Browse files
Merge pull request #293 from srobo/updates-page
Updates page
2 parents a32fce2 + 4b7c97c commit 869fa0e

File tree

7 files changed

+77
-5
lines changed

7 files changed

+77
-5
lines changed

_data/kit_versions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- version: 2022.0.0
2+
released: 2021-11-13

_data/sidebar_tree.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ tree:
1717
title: IMAX B6 Charger
1818
- url: /kit/brain_board
1919
title: Brain Board
20+
tree:
21+
- url: /kit/brain_board/updates
22+
title: Updates
2023
- url: /kit/motor_board
2124
title: Motor Board
2225
- url: /kit/power_board

_includes/script.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
{% endif %}
1212

1313
<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>
1415

1516
<script src="{{ '/js/navigation.js' | prepend: site.baseurl }}"></script>

_includes/updates-table.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<table id="updates-table">
2+
<tr>
3+
<th></th>
4+
<th>Release Date</th>
5+
<th>Download</th>
6+
<th>Licences</th>
7+
</tr>
8+
{% for kit_version in site.data.kit_versions %}
9+
{% assign version = kit_version.version %}
10+
<tr id="{{ version | slugify }}">
11+
<td>
12+
{% if forloop.first %}
13+
<code><strong>{{ version }}</strong></code>
14+
{% else %}
15+
<code>{{ version }}</code>
16+
{% endif %}
17+
</td>
18+
<td>{{ kit_version.released | date_to_string }}</td>
19+
<td>
20+
<a class="kit-download-link" data-version="{{ version }}" href="https://kit-downloads.studentrobotics.org/kit-software/{{ version }}/srobo-robot-{{ version }}.img.xz">
21+
Download {{ version }}
22+
</a>
23+
</td>
24+
<td><a href="https://kit-downloads.studentrobotics.org/kit-software/{{ version }}/srobo-robot-{{ version }}-licences">Licences</a></td>
25+
</tr>
26+
{% endfor %}
27+
</table>

js/updates.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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);

kit/brain_board.md renamed to kit/brain_board/index.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ layout: page
33
title: Brain Board
44
---
55

6+
{% comment %}
7+
The below will automatically calculate the latest version number, to be used when mentioning the version in this page.
8+
{% endcomment %}
9+
10+
{% assign latest_version = site.data.kit_versions | first %}
11+
{% assign latest_version = latest_version.version %}
12+
613
Brain Board
714
===========
815

@@ -17,23 +24,21 @@ The SD card is located on the underside of the board. Carefully open the Brain B
1724

1825
To fully update your Brain Board's software, or refresh it if you think it's not working correctly, you can flash our SD card image onto the microSD card in your Brain Board.
1926

20-
To update the SD card, you'll need to download our image, [`srobo-robot-2022.0.0.img.xz`][robot-image].
27+
To update the SD card, you'll need to download our image from the [updates page]({{ site.baseurl }}/kit/brain_board/updates). The latest version is `{{ latest_version }}`.
2128
The flashing procedure is identical to flashing Raspberry Pi images.
2229

23-
[robot-image]: https://kit-downloads.studentrobotics.org/kit-software/2022.0.0/srobo-robot-2022.0.0.img.xz
24-
2530
## Etcher
2631

2732
We recommend using [etcher](https://etcher.io), as it's simple to use, and available on Windows, macOS and Linux. If you're familiar with Raspberry Pis or other similar boards and have flashed images before with a different tool, that will also work.
2833

2934
![Etcher example]({{ site.baseurl }}/images/content/kit/etcher.png)
3035

3136
<div class="info" markdown="1">
32-
If you choose to use a tool other than Etcher, you may need to extract the `srobo-robot-2022.0.0.img.xz` to `srobo-robot-2022.0.0.img`. There are many tools available for this, e.g. [7-zip](http://www.7-zip.org/).
37+
If you choose to use a tool other than Etcher, you may need to extract the `srobo-robot-{{ latest_version }}.img.xz` to `srobo-robot-{{ latest_version }}.img`. There are many tools available for this, e.g. [7-zip](http://www.7-zip.org/).
3338
</div>
3439

3540
### Flashing
3641

37-
1. Open Etcher and select the `srobo-robot-2022.0.0.img.xz` file you downloaded
42+
1. Open Etcher and select the `srobo-robot-{{ latest_version }}.img.xz` file you downloaded
3843
2. Select your SD card from the devices window
3944
3. Click 'Flash!'

kit/brain_board/updates.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
layout: page
3+
title: Updates
4+
extra_js: updates
5+
---
6+
7+
# Updates
8+
9+
Keeping your kit up to date is very important. It enables us to deploy new features, as well as fix bugs.
10+
11+
Once you have downloaded the file you need, refer to the documentation on [updating your brain board]({{ site.baseurl }}/kit/brain_board#flashing-sd-card) to apply the update.
12+
13+
Each update file is a complete upgrade. Each file contains the changes of those before it. If you need to jump up multiple versions, you can do so by using the latest file.
14+
15+
The following table outlines the updates which have been published.
16+
17+
{% include updates-table.html %}

0 commit comments

Comments
 (0)