diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-07-24 09:00:23 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-12-27 18:44:47 +0100 |
commit | 3cdf19e9b7e46c57a9bb43ff02199177feb55768 (patch) | |
tree | d05e3dc15824c8eeef3e5455193d2d6328621f47 | |
parent | 02f2735f68e1bb2e2c412698755d52c4d396f237 (diff) |
:sparkles: Implement Page bundling and image handling
This commit is not the smallest in Hugo's history.
Some hightlights include:
* Page bundles (for complete articles, keeping images and content together etc.).
* Bundled images can be processed in as many versions/sizes as you need with the three methods `Resize`, `Fill` and `Fit`.
* Processed images are cached inside `resources/_gen/images` (default) in your project.
* Symbolic links (both files and dirs) are now allowed anywhere inside /content
* A new table based build summary
* The "Total in nn ms" now reports the total including the handling of the files inside /static. So if it now reports more than you're used to, it is just **more real** and probably faster than before (see below).
A site building benchmark run compared to `v0.31.1` shows that this should be slightly faster and use less memory:
```bash
▶ ./benchSite.sh "TOML,num_langs=.*,num_root_sections=5,num_pages=(500|1000),tags_per_page=5,shortcodes,render"
benchmark old ns/op new ns/op delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 101785785 78067944 -23.30%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 185481057 149159919 -19.58%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 103149918 85679409 -16.94%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 203515478 169208775 -16.86%
benchmark old allocs new allocs delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 532464 391539 -26.47%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1056549 772702 -26.87%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 555974 406630 -26.86%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1086545 789922 -27.30%
benchmark old bytes new bytes delta
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 53243246 43598155 -18.12%
BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 105811617 86087116 -18.64%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 54558852 44545097 -18.35%
BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 106903858 86978413 -18.64%
```
Fixes #3651
Closes #3158
Fixes #1014
Closes #2021
Fixes #1240
Updates #3757
85 files changed, 5747 insertions, 3243 deletions
diff --git a/Gopkg.lock b/Gopkg.lock index 4233d9278..44f957d18 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -21,7 +21,13 @@ [[projects]] name = "github.com/alecthomas/chroma" - packages = [".","formatters","formatters/html","lexers","styles"] + packages = [ + ".", + "formatters", + "formatters/html", + "lexers", + "styles" + ] revision = "v0.2.0" [[projects]] @@ -54,21 +60,26 @@ version = "v1.1.0" [[projects]] - branch = "master" - name = "github.com/dchest/cssmin" + name = "github.com/disintegration/imaging" packages = ["."] - revision = "fb8d9b44afdc258bfff6052d3667521babcb2239" + revision = "v1.2.4" [[projects]] name = "github.com/dlclark/regexp2" - packages = [".","syntax"] + packages = [ + ".", + "syntax" + ] revision = "487489b64fb796de2e55f4e8a4ad1e145f80e957" version = "v1.1.6" [[projects]] branch = "master" name = "github.com/eknkc/amber" - packages = [".","parser"] + packages = [ + ".", + "parser" + ] revision = "cdade1c073850f4ffc70a829e31235ea6892853b" [[projects]] @@ -104,7 +115,17 @@ [[projects]] branch = "master" name = "github.com/hashicorp/hcl" - packages = [".","hcl/ast","hcl/parser","hcl/scanner","hcl/strconv","hcl/token","json/parser","json/scanner","json/token"] + packages = [ + ".", + "hcl/ast", + "hcl/parser", + "hcl/scanner", + "hcl/strconv", + "hcl/token", + "json/parser", + "json/scanner", + "json/token" + ] revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" [[projects]] @@ -115,7 +136,10 @@ [[projects]] name = "github.com/jdkato/prose" - packages = ["internal/util","transform"] + packages = [ + "internal/util", + "transform" + ] revision = "20d3663d4bc9dd10d75abcde9d92e04b4861c674" version = "v1.1.0" @@ -133,7 +157,10 @@ [[projects]] name = "github.com/magefile/mage" - packages = ["mg","sh"] + packages = [ + "mg", + "sh" + ] revision = "2f974307b636f59c13b88704cf350a4772fef271" version = "v1.0.2" @@ -150,6 +177,12 @@ revision = "54ffb37507cd7d2ccd4768855e84f9ff6c4352b6" [[projects]] + name = "github.com/mattn/go-runewidth" + packages = ["."] + revision = "9e777a8366cce605130a531d2cd6363d07ad7317" + version = "v0.0.2" + +[[projects]] name = "github.com/miekg/mmark" packages = ["."] revision = "fd2f6c1403b37925bd7fe13af05853b8ae58ee5f" @@ -163,11 +196,21 @@ [[projects]] name = "github.com/nicksnyder/go-i18n" - packages = ["i18n/bundle","i18n/language","i18n/translation"] + packages = [ + "i18n/bundle", + "i18n/language", + "i18n/translation" + ] revision = "0dc1626d56435e9d605a29875701721c54bc9bbd" version = "v1.10.0" [[projects]] + branch = "master" + name = "github.com/olekukonko/tablewriter" + packages = ["."] + revision = "65fec0d89a572b4367094e2058d3ebe667de3b60" + +[[projects]] name = "github.com/pelletier/go-toml" packages = ["."] revision = "16398bac157da96aa88f98a2df640c7f32af1da2" @@ -193,7 +236,10 @@ [[projects]] name = "github.com/spf13/afero" - packages = [".","mem"] + packages = [ + ".", + "mem" + ] revision = "8d919cbe7e2627e417f3e45c3c0e489a5b7e2536" version = "v1.0.0" @@ -206,7 +252,10 @@ [[projects]] branch = "master" name = "github.com/spf13/cobra" - packages = [".","doc"] + packages = [ + ".", + "doc" + ] revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" [[projects]] @@ -241,7 +290,10 @@ [[projects]] name = "github.com/stretchr/testify" - packages = ["assert","require"] + packages = [ + "assert", + "require" + ] revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" version = "v1.1.4" @@ -254,17 +306,34 @@ [[projects]] branch = "master" name = "golang.org/x/image" - packages = ["riff","vp8","vp8l","webp"] + packages = [ + "bmp", + "riff", + "tiff", + "tiff/lzw", + "vp8", + "vp8l", + "webp" + ] revision = "f7e31b4ea2e3413ab91b4e7d2dc83e5f8d19a44c" [[projects]] branch = "master" name = "golang.org/x/net" - packages = ["idna"] + packages = [ + "context", + "idna" + ] rev |