Anthony Fok [Fri, 1 Nov 2019 15:46:54 +0000 (09:46 -0600)]
Update .travis.yml for arm64 support, etc.
- Add arm64 support for Linux thanks to Travis CI’s new feature, see
https://blog.travis-ci.com/2019-10-07-multi-cpu-architecture-support
- Force GO111MODULE=on
- Cache directories
- Switch to bionic (Ubuntu 18.04) environment
- Use "master" instead of "tip" to match the latest Travis CI docs
- Allow "mage -v check" to fail on non-AMD64 architectures
because "go test -race ./..." currently fails on arm64 and ppc64le.
Jake Jarvis [Wed, 9 Oct 2019 15:27:08 +0000 (11:27 -0400)]
Dockerfile: Switch to mage builds, various optimizations
- Use Alpine for both stages for consistency.
- Switch to mage from go install as dictated in the latest docs.
- Easy switch to building Hugo Extended by directly setting HUGO_BUILD_TAGS flag at image build time: `docker build --build-arg HUGO_BUILD_TAGS=extended .`
- Update to Go 1.13 and Alpine 3.10.
- The only possibly breaking change: Moved the `hugo` binary in the final stage from /hugo to /usr/bin/hugo so one can simply run `hugo` without having to search around for its location.
Zach Bayoff [Sat, 12 Oct 2019 16:10:14 +0000 (12:10 -0400)]
tpl: Add optional "title" attribute to iframe in Vimeo shortcode
Add an optional "title" attribute to the iframe in the vimeo shortcode. If one is not given, the title attribute will default to "vimeo video". It is imperative for iframes to have a non-empty "title" attribute in order to meet WCAG2.0 accessibility guidelines https://www.w3.org/TR/WCAG20-TECHS/H64.
Baibhav Vatsa [Fri, 11 Oct 2019 18:51:24 +0000 (13:51 -0500)]
tpl: Modify error messages of after, first, and last
Modified the messages functions after, first, and last threw on being passed invalid parameters (index or limit) to be more standardised and resemble what Go compiler would throw.
Baibhav Vatsa [Fri, 11 Oct 2019 18:15:39 +0000 (13:15 -0500)]
tpl: Last now accepts 0 as limit
Modified the if conditional because of which last threw an error if 0 was passed as limit. The function now returns an empty slice if it is called with 0 as limit. The behavior of first and last is now the same when 0 is passed as limit. Also added tests to test the new behavior.
Baibhav Vatsa [Fri, 11 Oct 2019 01:16:15 +0000 (20:16 -0500)]
tpl: After now accepts 0 as index
Modified the if conditional because of which after threw an error if called with 0 as index. The function now returns the whole original slice if 0 is passed as an index. Also added tests to test the new behavior.
Anthony Fok [Wed, 9 Oct 2019 05:46:04 +0000 (23:46 -0600)]
deps: Update minify to v2.5.2
- v2.5.1 removes import comments, solving a build error with Go 1.13
in GOPATH mode (used Debian packaging for example)
- v2.5.2 no longer converts polyline/rect/polygon/line to path
as it has been reported to break a SVG referenced by CSS,
see tdewolff/minify#260
The test case for Min SVG in TestResourceChains is updated accordingly.
Anthony Fok [Mon, 7 Oct 2019 18:35:00 +0000 (12:35 -0600)]
resources: Fix image test error on s390x, ppc64* and arm64
In TestImageOperationsGolden, tolerate slight floating-point rounding
differences due to the use or non-use of "fused multiply and add" (FMA)
instruction on different architectures.
Special thanks to @disintegration for the solution in goldenEqual();
see https://github.com/disintegration/gift/issues/20
Niklas Fasching [Thu, 3 Oct 2019 21:27:51 +0000 (23:27 +0200)]
Add BaseFs to RenderingContext
The org mode renderer supports including other files [1]. We don't want to
allow reading of arbitrary files (go-org defaults to ioutil.ReadFile [2]) but want
to make use of the FileSystem abstractions hugo provides. For starters we will
allow reading from the content directory only
[1]: e.g. `#+INCLUDE: ./foo.py src python` includes `foo.py` as a python source
block.
J. Ansorg [Sat, 21 Sep 2019 14:50:27 +0000 (16:50 +0200)]
resources: Support output image format in image operations
The image format is defined as the image extension of the known formats,
excluding the dot.
All of 'img.Resize "600x jpeg"', 'img.Resize "600x jpg"',
and 'img.Resize "600x png"' are valid format definitions.
If the target format is defined in the operation definition string,
then the converted image will be stored in this format. Permalinks and
media type are updated correspondingly.
Unknown image extensions in the operation definition have not effect.