From 4f9eaca04f50d9f9c90b350501a146aacf106bdc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:06:47 +0000 Subject: [PATCH 01/10] Upgrade Hugo to 0.36.1 --- .circleci/config.yml | 2 +- netlify.toml | 6 +++--- shell.nix | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef5e7292..a63dfbfa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: command: git submodule sync && git submodule update --init - run: name: Install Hugo - command: wget https://github.com/gohugoio/hugo/releases/download/v0.33/hugo_0.33_Linux-64bit.deb -O /tmp/hugo.deb && sudo dpkg -i /tmp/hugo.deb + command: wget https://github.com/gohugoio/hugo/releases/download/v0.36.1/hugo_0.36.1_Linux-64bit.deb -O /tmp/hugo.deb && sudo dpkg -i /tmp/hugo.deb - restore_cache: key: node-{{ checksum "package.json" }} - run: diff --git a/netlify.toml b/netlify.toml index e503c244..d8b12b00 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,11 +3,11 @@ command = "./scripts/build.sh" [context.production.environment] - HUGO_VERSION = "0.33" + HUGO_VERSION = "0.36.1" HUGO_ENV = "production" [context.deploy-preview.environment] - HUGO_VERSION = "0.33" + HUGO_VERSION = "0.36.1" [context.branch-deploy.environment] - HUGO_VERSION = "0.33" + HUGO_VERSION = "0.36.1" diff --git a/shell.nix b/shell.nix index e8d90adf..b2fefcd3 100644 --- a/shell.nix +++ b/shell.nix @@ -2,8 +2,8 @@ with pkgs; -# Require hugo >= 0.33. -assert (builtins.compareVersions hugo.version "0.33") >= 0; +# Require hugo >= 0.36.1. +assert (builtins.compareVersions hugo.version "0.36.1") >= 0; stdenv.mkDerivation { name = "docs-env"; From 7d3ce6848ee593ea2d77238859462b64376d90f7 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:16:15 +0000 Subject: [PATCH 02/10] Add resource shortcode --- layouts/shortcodes/resource.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 layouts/shortcodes/resource.html diff --git a/layouts/shortcodes/resource.html b/layouts/shortcodes/resource.html new file mode 100644 index 00000000..33f78264 --- /dev/null +++ b/layouts/shortcodes/resource.html @@ -0,0 +1,19 @@ +{{ $original := .Page.Resources.GetMatch (.Get "src") }} +{{ $options := .Get "options" }} + +{{ .Scratch.Set "image" $original }} + +{{ if $options }} + {{ $command := (default "Resize" (.Get "command")) }} + {{ if eq $command "Fit"}} + {{ .Scratch.Set "image" ($original.Fit $options) }} + {{ else if eq $command "Resize"}} + {{ .Scratch.Set "image" ($original.Resize $options) }} + {{ else if eq $command "Fill"}} + {{ .Scratch.Set "image" ($original.Fill $options) }} + {{ end }} +{{ end }} + +{{ $image := .Scratch.Get "image" }} + + From f2bf148c5bc1068f8bfcc6e235730b4dda054a20 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:18:31 +0000 Subject: [PATCH 03/10] Add imaging render config --- config.yml | 4 ++++ scripts/build.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index bc15de2a..1a2f5214 100644 --- a/config.yml +++ b/config.yml @@ -38,3 +38,7 @@ outputs: - json buildFuture: true + +imaging: + resampleFilter: Lanczos + quality: 100 diff --git a/scripts/build.sh b/scripts/build.sh index 4931be6d..ca092a78 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -8,4 +8,4 @@ rm -rf public/ rm -rf content/tutorials/kit-assembly.files cp -r static/img/assembly content/tutorials/kit-assembly.files -hugo -v +hugo -v --gc From 633a512289d378042b22ee6877d8fdaba5afe395 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:25:51 +0000 Subject: [PATCH 04/10] Use page bundles for marker PDFs --- content/markers/_index.md | 11 ++++------- {static/docs => content/markers}/large-tags.pdf | Bin {static/docs => content/markers}/small-tags.pdf | Bin 3 files changed, 4 insertions(+), 7 deletions(-) rename {static/docs => content/markers}/large-tags.pdf (100%) rename {static/docs => content/markers}/small-tags.pdf (100%) diff --git a/content/markers/_index.md b/content/markers/_index.md index d5c6dab2..268b161d 100644 --- a/content/markers/_index.md +++ b/content/markers/_index.md @@ -7,10 +7,7 @@ Our vision system uses the [AprilTag](https://april.eecs.umich.edu/software/apri Here you can download PDF files of all markers: -| PDF | Marker Size | Paper Size | -|-----------------------------------|-------------|------------| -| [Large markers][large-marker-pdf] | 250x250mm | A3 | -| [Small markers][small-marker-pdf] | 100x100mm | A4 | - -[large-marker-pdf]: /docs/large-tags.pdf -[small-marker-pdf]: /docs/small-tags.pdf +| PDF | Marker Size | Paper Size | +|---------------------------------|-------------|------------| +| [Large markers](large-tags.pdf) | 250x250mm | A3 | +| [Small markers](small-tags.pdf) | 100x100mm | A4 | diff --git a/static/docs/large-tags.pdf b/content/markers/large-tags.pdf similarity index 100% rename from static/docs/large-tags.pdf rename to content/markers/large-tags.pdf diff --git a/static/docs/small-tags.pdf b/content/markers/small-tags.pdf similarity index 100% rename from static/docs/small-tags.pdf rename to content/markers/small-tags.pdf From 0e1691c8aba49bd9343cd0b3e99b424be1dbb846 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:28:45 +0000 Subject: [PATCH 05/10] Remove duplicate content on marker PDFs --- content/api/vision/_index.md | 6 ------ content/markers/_index.md | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/content/api/vision/_index.md b/content/api/vision/_index.md index 9a6a7f94..ac27de37 100644 --- a/content/api/vision/_index.md +++ b/content/api/vision/_index.md @@ -25,9 +25,3 @@ The markers in the list have some useful attributes: {{% notice tip %}} A marker's position can be represented using both the [Cartesian](coordinates/#cartesian-coordinates) and [spherical](coordinates/#spherical-coordinates) coordinate systems. {{% /notice %}} - -## Marker PDFs -You can download PDF files of all markers: - -- [Large markers](/docs/large-tags.pdf), Containing Wall and Column markers (250x250mm, should be printed on A3) -- [Small markers](/docs/small-tags.pdf), Containing Token markers (100x100mm, should be printed on A4) diff --git a/content/markers/_index.md b/content/markers/_index.md index 268b161d..1a9a0952 100644 --- a/content/markers/_index.md +++ b/content/markers/_index.md @@ -7,7 +7,7 @@ Our vision system uses the [AprilTag](https://april.eecs.umich.edu/software/apri Here you can download PDF files of all markers: -| PDF | Marker Size | Paper Size | -|---------------------------------|-------------|------------| -| [Large markers](large-tags.pdf) | 250x250mm | A3 | -| [Small markers](small-tags.pdf) | 100x100mm | A4 | +| PDF | Marker Size | Paper Size | Contents | +|---------------------------------|-------------|------------|--------------| +| [Large markers](large-tags.pdf) | 250x250mm | A3 | Wall, Column | +| [Small markers](small-tags.pdf) | 100x100mm | A4 | Token | From e32bfd222e778360b623b66b2d46f4249c418657 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:35:42 +0000 Subject: [PATCH 06/10] Move rulebook to resource --- content/rules/_index.md | 2 +- {static => content/rules}/rules.pdf | Bin .../shortcodes/{resource.html => resource_img.html} | 0 layouts/shortcodes/resource_link.html | 2 ++ 4 files changed, 3 insertions(+), 1 deletion(-) rename {static => content/rules}/rules.pdf (100%) rename layouts/shortcodes/{resource.html => resource_img.html} (100%) create mode 100644 layouts/shortcodes/resource_link.html diff --git a/content/rules/_index.md b/content/rules/_index.md index 0bb53c02..646f729d 100644 --- a/content/rules/_index.md +++ b/content/rules/_index.md @@ -5,4 +5,4 @@ weight: 1 You can find the rules for SourceBots 2018 below: -# [Download the rules!](/rules.pdf) +# {{% resource_link src="rules.pdf" %}}Download the rules{{% /resource_link %}} diff --git a/static/rules.pdf b/content/rules/rules.pdf similarity index 100% rename from static/rules.pdf rename to content/rules/rules.pdf diff --git a/layouts/shortcodes/resource.html b/layouts/shortcodes/resource_img.html similarity index 100% rename from layouts/shortcodes/resource.html rename to layouts/shortcodes/resource_img.html diff --git a/layouts/shortcodes/resource_link.html b/layouts/shortcodes/resource_link.html new file mode 100644 index 00000000..9cd1e67b --- /dev/null +++ b/layouts/shortcodes/resource_link.html @@ -0,0 +1,2 @@ +{{ $resource := .Page.Resources.GetMatch (.Get "src") }} +{{ .Inner }} From d0932b3c9fa6250b649e74f3c9cb7003df2eb365 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 19 Feb 2018 21:45:21 +0000 Subject: [PATCH 07/10] Move coordinates diagram to resources --- .../api/vision/coordinates}/coordinate-spaces.svg | 0 content/api/vision/{coordinates.md => coordinates/index.md} | 3 ++- layouts/shortcodes/resource_img.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename {static/img/api => content/api/vision/coordinates}/coordinate-spaces.svg (100%) rename content/api/vision/{coordinates.md => coordinates/index.md} (96%) diff --git a/static/img/api/coordinate-spaces.svg b/content/api/vision/coordinates/coordinate-spaces.svg similarity index 100% rename from static/img/api/coordinate-spaces.svg rename to content/api/vision/coordinates/coordinate-spaces.svg diff --git a/content/api/vision/coordinates.md b/content/api/vision/coordinates/index.md similarity index 96% rename from content/api/vision/coordinates.md rename to content/api/vision/coordinates/index.md index f71ec2b6..afe4b150 100644 --- a/content/api/vision/coordinates.md +++ b/content/api/vision/coordinates/index.md @@ -52,4 +52,5 @@ robot, exactly 1 metre away. The following diagram shows the orientation of the Cartesian axes relative to the camera as well as the angles which describe the spherical coordinate space. -![A diagram showing the coordinate spaces](/img/api/coordinate-spaces.svg) + +{{% resource_img src="coordinate-spaces.svg" alt="A diagram showing the coordinate spaces" %}} diff --git a/layouts/shortcodes/resource_img.html b/layouts/shortcodes/resource_img.html index 33f78264..22d5b3da 100644 --- a/layouts/shortcodes/resource_img.html +++ b/layouts/shortcodes/resource_img.html @@ -16,4 +16,4 @@ {{ $image := .Scratch.Get "image" }} - +{{ .Get From b778c304cbb99a1d8a4ebc1d9daa8d84b0763a5d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 20 Feb 2018 08:42:37 +0000 Subject: [PATCH 08/10] Replace static/docs with page resources Fixes #108 --- .../kit/{motor-board.md => motor-board/index.md} | 2 +- .../kit/motor-board}/motor-schematic.pdf | Bin .../kit/{power-board.md => power-board/index.md} | 2 +- .../kit/power-board}/power-schematic.pdf | Bin 4 files changed, 2 insertions(+), 2 deletions(-) rename content/kit/{motor-board.md => motor-board/index.md} (96%) rename {static/docs => content/kit/motor-board}/motor-schematic.pdf (100%) rename content/kit/{power-board.md => power-board/index.md} (97%) rename {static/docs => content/kit/power-board}/power-schematic.pdf (100%) diff --git a/content/kit/motor-board.md b/content/kit/motor-board/index.md similarity index 96% rename from content/kit/motor-board.md rename to content/kit/motor-board/index.md index 95720cfe..20f28621 100644 --- a/content/kit/motor-board.md +++ b/content/kit/motor-board/index.md @@ -34,7 +34,7 @@ The case measures 70x84x20mm. Don’t forget that the cables will stick out. ## Designs You can access the schematics and source code of the firmware on the motor board in the following places. You do not need this information to use the board but it may be of interest to some people. -- [Full Schematics](/docs/motor-schematic.pdf) +- {{% resource_link src="motor-schematic.pdf" %}}Full Schematic{{% /resource_link %}} - [Firmware Source](https://github.com/sourcebots/motor-v4-fw) - [Hardware Source](https://github.com/sourcebots/motor-v4-hw) diff --git a/static/docs/motor-schematic.pdf b/content/kit/motor-board/motor-schematic.pdf similarity index 100% rename from static/docs/motor-schematic.pdf rename to content/kit/motor-board/motor-schematic.pdf diff --git a/content/kit/power-board.md b/content/kit/power-board/index.md similarity index 97% rename from content/kit/power-board.md rename to content/kit/power-board/index.md index 38934a9a..df329432 100644 --- a/content/kit/power-board.md +++ b/content/kit/power-board/index.md @@ -63,6 +63,6 @@ The case measures 83x99x24mm. Don’t forget that the cables will stick out. ## Designs You can access the schematics and source code of the firmware for the power board in the following places. You do not need this information to use the board but it may be of interest to some people. -- [Full Schematics](/docs/power-schematic.pdf) +- {{% resource_link src="power-schematic.pdf" %}}Full Schematic{{% /resource_link %}} - [Firmware Source](https://github.com/sourcebots/power-v4-fw) - [Hardware Source](https://github.com/sourcebots/power-v4-hw) diff --git a/static/docs/power-schematic.pdf b/content/kit/power-board/power-schematic.pdf similarity index 100% rename from static/docs/power-schematic.pdf rename to content/kit/power-board/power-schematic.pdf From 5a1b5ef09bfa56fa123da734bd5a848d95744985 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 20 Feb 2018 08:51:06 +0000 Subject: [PATCH 09/10] Upgrade theme whilst we're at it --- themes/learn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/learn b/themes/learn index 6562adeb..335d574d 160000 --- a/themes/learn +++ b/themes/learn @@ -1 +1 @@ -Subproject commit 6562adeb7b3ead1e199272b450a61ad07faf48f4 +Subproject commit 335d574d80b7901a017d6bc4b962821346eeaabe From c6769b00195b58cf88aadbd3befc4a24b24b99ee Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 20 Feb 2018 08:55:06 +0000 Subject: [PATCH 10/10] Update readme with hugo version change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d370876..5079939f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ URL: http://docs.sourcebots.co.uk ## Requirements -- [Hugo](https://gohugo.io) (>=0.33) +- [Hugo](https://gohugo.io) (>=0.36.1) - [NodeJS](https://nodejs.org/) (>=6) (required for tests only) ## Style notes