Commit graph

70 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
c7f057797c travis: Set GO111MODULE=on for mage install
See #5115
2018-08-28 11:22:50 +02:00
Bjørn Erik Pedersen
45c9c45d1d Use Go 1.11 modules with Mage
See #5115
2018-08-25 20:50:58 +02:00
Bjørn Erik Pedersen
d32ff16fd6 Update Travis to Go 1.11 and Go 1.10.4
See #5115
2018-08-25 17:37:42 +02:00
Bjørn Erik Pedersen
dea71670c0
Add Hugo Piper with SCSS support and much more
Before this commit, you would have to use page bundles to do image processing etc. in Hugo.

This commit adds

* A new `/assets` top-level project or theme dir (configurable via `assetDir`)
* A new template func, `resources.Get` which can be used to "get a resource" that can be further processed.

This means that you can now do this in your templates (or shortcodes):

```bash
{{ $sunset := (resources.Get "images/sunset.jpg").Fill "300x200" }}
```

This also adds a new `extended` build tag that enables powerful SCSS/SASS support with source maps. To compile this from source, you will also need a C compiler installed:

```
HUGO_BUILD_TAGS=extended mage install
```

Note that you can use output of the SCSS processing later in a non-SCSSS-enabled Hugo.

The `SCSS` processor is a _Resource transformation step_ and it can be chained with the many others in a pipeline:

```bash
{{ $css := resources.Get "styles.scss" | resources.ToCSS | resources.PostCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen">
```

The transformation funcs above have aliases, so it can be shortened to:

```bash
{{ $css := resources.Get "styles.scss" | toCSS | postCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen">
```

A quick tip would be to avoid the fingerprinting part, and possibly also the not-superfast `postCSS` when you're doing development, as it allows Hugo to be smarter about the rebuilding.

Documentation will follow, but have a look at the demo repo in https://github.com/bep/hugo-sass-test

New functions to create `Resource` objects:

* `resources.Get` (see above)
* `resources.FromString`: Create a Resource from a string.

New `Resource` transformation funcs:

* `resources.ToCSS`: Compile `SCSS` or `SASS` into `CSS`.
* `resources.PostCSS`: Process your CSS with PostCSS. Config file support (project or theme or passed as an option).
* `resources.Minify`: Currently supports `css`, `js`, `json`, `html`, `svg`, `xml`.
* `resources.Fingerprint`: Creates a fingerprinted version of the given Resource with Subresource Integrity..
* `resources.Concat`: Concatenates a list of Resource objects. Think of this as a poor man's bundler.
* `resources.ExecuteAsTemplate`: Parses and executes the given Resource and data context (e.g. .Site) as a Go template.

Fixes #4381
Fixes #4903
Fixes #4858
2018-07-06 11:46:12 +02:00
Anthony Fok
23d5fc82ee
Update to Go 1.9.7 and Go 1.10.3
for Travis CI, Docker and Snap
2018-06-14 15:50:25 -06:00
Bjørn Erik Pedersen
230f2b8c4f
Bump Go versions
Fixes #4545
2018-04-09 11:01:01 +02:00
Anthony Fok
094ec17142
travis: Disable shallow clone to fix TestPageWithLastmodFromGitInfo
Fixes #4584
2018-04-07 06:54:24 -06:00
Anthony Fok
60e66d12ea travis: Clean up and increase verbosity 2018-04-02 09:20:58 +02:00
Anthony Fok
eb15ac37ef travis: Run "gem install" without sudo
Running "sudo gem install" was causing random errors like the following:

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /home/travis/.rvm/gems/ruby-2.4.1/cache/asciidoctor-1.5.6.2.gem

Perhaps sudo is no longer necessary, even on OS X?  :-)
2018-04-02 08:15:35 +02:00
Anthony Fok
511d5d3b76 travis: Move to Ubuntu Trusty image 2018-03-26 09:09:58 -06:00
Bjørn Erik Pedersen
a3f26e5636
Second try: Update to Go 1.10 (!) 2018-02-17 00:35:22 +01:00
Bjørn Erik Pedersen
0c452c6e7d
Revert "Update to Go 1.10 (!)"
This reverts commit ff10c15a93.
2018-02-16 23:42:42 +01:00
Bjørn Erik Pedersen
ff10c15a93
Update to Go 1.10 (!)
See https://blog.golang.org/go1.10
2018-02-16 23:29:51 +01:00
Bjørn Erik Pedersen
0de375a7e7
Bump Travis/Snapcraft to Go 1.9.4 2018-02-07 21:45:53 +01:00
Bjørn Erik Pedersen
96e3fbcf23
travis: Re-enable macOS builds 2018-01-26 17:08:32 +01:00
Bjørn Erik Pedersen
a91aba1c15
Update to Go 1.9.3
Fixes #4328
2018-01-26 17:07:08 +01:00
Bjørn Erik Pedersen
22ad1ebdbb
travis: Disable macOS builds for now
Travis have not been able to build those the last week or so.
2018-01-23 12:59:40 +01:00
Bjørn Erik Pedersen
77cbd001ff
Update Travis and snapcraft to Go 1.9.2
See #4064
2017-11-08 00:37:59 +01:00
Bjørn Erik Pedersen
856fc445da
Bump Go versions in Travis config 2017-10-05 18:50:36 +02:00
Bjørn Erik Pedersen
8d2580f07c Replace make with mage
Fixes #3937
2017-10-05 10:53:02 +02:00
Bjørn Erik Pedersen
fc4a0d1704 Update Travis build to Go 1.9!
Just released: https://blog.golang.org/go1.9
2017-08-25 08:08:17 +02:00
Bjørn Erik Pedersen
07f6e1499c travis: Pull docutils out into requirements.txt 2017-08-11 18:39:04 +02:00
Bjørn Erik Pedersen
e8468a9852 travis: Fix docutils setup 2017-08-11 17:23:40 +02:00
Bjørn Erik Pedersen
359af563a1 travis: Try to fix docutils setup on Linux 2017-08-11 14:21:21 +02:00
Bjørn Erik Pedersen
7198ea8a1e Revert "Remove docs building from CI builds"
Now /docs is a Git subtree, so now this should just work.

This reverts commit 214dbdfb6f.
2017-06-26 21:05:21 +02:00
Bjørn Erik Pedersen
214dbdfb6f Remove docs building from CI builds
We could probably get it working, but we have plenty of site tests now.
2017-06-14 11:16:06 +02:00
Bjørn Erik Pedersen
bde807bd1e travis: Update Go versions 2017-05-26 10:49:40 +03:00
Bjørn Erik Pedersen
9a8b65d8d7 travis: Go 1.8.1 2017-04-07 20:30:45 +02:00
Bjørn Erik Pedersen
b7aa230458 travis: Bump to Go 1.7.5 and 1.8 (Yay!) 2017-02-17 17:39:33 +01:00
Cameron Moore
1d7b960614 Clean up Makefile (#2924)
Add missing deprecated targets.  Remove `test` from `check` target since
we already have `test-race`.

Fixes #2901
2017-01-11 10:07:35 +01:00
Bjørn Erik Pedersen
6374d82b82 travis: Add GOARCH 386 test
Closes #2847
2016-12-29 16:44:39 +01:00
Cameron Moore
f25f837339 Update Travis go versions 2016-12-23 09:49:15 +01:00
Bjørn Erik Pedersen
1992b356b0 Bump Travis to Go 1.7.3 2016-10-19 21:53:56 +02:00
Bjørn Erik Pedersen
27d7aa5f10 travis: Reintroduce asciidoctor to build
Fixes #2524
2016-10-06 09:31:57 +02:00
Bjørn Erik Pedersen
00b3667f30 travis: Remove asciidoctor from build
It fails. Will have to investigate.
2016-10-05 14:36:50 +02:00
Bjørn Erik Pedersen
217d6ea605 travis: Fix asciidoctor build 2016-10-05 14:35:02 +02:00
Bjørn Erik Pedersen
f37f57a814 travis: Lock asciidoctor to 1.5.4
1.5.5 (the newly released) seems to break.
2016-10-05 14:11:56 +02:00
Cameron Moore
6e692f2d11 Add vendoring with govendor 2016-09-19 00:10:10 +02:00
Bjørn Erik Pedersen
a8fad86671 Bump Travis to Go 1.7.1 2016-09-08 00:37:04 +03:00
Cameron Moore
d3627b1747 Simplify Travis build 2016-08-16 17:01:59 -05:00
Bjørn Erik Pedersen
2175ea5b06 Bump Travis to Go 1.7 2016-08-16 10:05:10 +02:00
Bjørn Erik Pedersen
802d43cbfd Disable Go 1.5.4 in Travis
There is one failing test there now, a odd filesystem issue.

Since Go 1.7 is only "days" away, I'm not spending time debugging this.
2016-07-30 19:37:15 +02:00
Bjørn Erik Pedersen
7dd5cd675a Bump Travis to Go 1.6.3 2016-07-18 23:46:37 +02:00
Bjørn Erik Pedersen
770df77b22 Add Docutils to Travis
Fixes #2255
Closes #2254
2016-07-04 12:58:14 +02:00
Bjørn Erik Pedersen
05a33e314e Add Asciidoctor to Travis
Fixes #2250
2016-07-04 12:58:09 +02:00
Anthony Fok
5572e3496b Update Travis config to Go 1.6.2 2016-06-29 23:05:48 -06:00
Bjørn Erik Pedersen
dc8659c539 Update Travis config to Go 1.5.4 and 1.6.1 2016-04-13 16:17:43 +02:00
Bjørn Erik Pedersen
969f9311c1 Build Hugo in Travis with race detection enabled 2016-04-07 13:40:18 +02:00
Bjørn Erik Pedersen
691c2ea970 Do make check in Travis 2016-03-22 23:14:17 +01:00
Bjørn Erik Pedersen
253a618854 Go 1.6 is out! 2016-02-17 23:18:54 +01:00