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/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 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/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/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/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 diff --git a/content/markers/_index.md b/content/markers/_index.md index d5c6dab2..1a9a0952 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 | Contents | +|---------------------------------|-------------|------------|--------------| +| [Large markers](large-tags.pdf) | 250x250mm | A3 | Wall, Column | +| [Small markers](small-tags.pdf) | 100x100mm | A4 | Token | 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 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_img.html b/layouts/shortcodes/resource_img.html new file mode 100644 index 00000000..22d5b3da --- /dev/null +++ b/layouts/shortcodes/resource_img.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" }} + +{{ .Get 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 }} 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/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 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"; 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