hugo/hugolib
Bjørn Erik Pedersen 3cdf19e9b7
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
2017-12-27 18:44:47 +01:00
..
testdata hugolib: Clean up a benchmark 2017-01-03 17:08:59 +01:00
404_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
alias.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
alias_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
author.go Revert the "standardize author data" 2016-09-18 19:16:39 +02:00
case_insensitive_test.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
config.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
config_test.go Add support for multiple config files via --config a.toml,b.toml,c.toml 2017-08-09 20:13:02 +02:00
datafiles_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
disableKinds_test.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
embedded_shortcodes_test.go Use Chroma as new default syntax highlighter 2017-09-25 08:59:02 +02:00
fileInfo.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
fileInfo_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
gitinfo.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
hugo_info.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
hugo_sites.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
hugo_sites_build.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
hugo_sites_build_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
hugo_sites_multihost_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
hugolib.debug Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
media.go Fix copyright headers in source files 2015-12-07 19:57:01 +01:00
menu.go Add .Title and .Page to MenuEntry 2017-12-15 18:49:21 +01:00
menu_test.go Add .Title and .Page to MenuEntry 2017-12-15 18:49:21 +01:00
multilingual.go Add multilingual multihost support 2017-11-17 11:01:46 +01:00
node_as_page_test.go all: Update textual references in Go source to point to gohugoio/hugo 2017-06-13 18:47:17 +02:00
page.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_bundler.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_bundler_capture.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_bundler_capture_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_bundler_handlers.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_bundler_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_collections.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_collections_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_output.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_paths.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_paths_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_permalink_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
page_resource.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_taxonomy_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
page_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
page_time_integration_test.go all: Update textual references in Go source to point to gohugoio/hugo 2017-06-13 18:47:17 +02:00
pageCache.go hugolib: Implement "related content" 2017-09-06 00:20:02 +02:00
pageCache_test.go hugolib: Implement "related content" 2017-09-06 00:20:02 +02:00
pageGroup.go hugolib: Pre-allocate some slices 2017-11-11 09:39:43 +01:00
pageGroup_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
pages_related.go hugolib: Fix typo in aquired 2017-09-07 16:21:33 +02:00
pages_related_test.go Clean up lint in various packages 2017-09-29 16:23:16 +02:00
pageSort.go hugolib: Enhance .Param to permit arbitrarily nested parameter references 2017-02-19 08:50:08 +01:00
pageSort_test.go hugolib: Implement "related content" 2017-09-06 00:20:02 +02:00
pagesPrevNext.go huglib: Add even more missing GoDoc 2016-04-07 16:05:23 +02:00
pagesPrevNext_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
pagination.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
pagination_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
path_separators_test.go hugolib, output: Incorporate suffix and type in layout resolve 2017-03-27 15:43:56 +02:00
permalinker.go hugolib: Add optional outputFormat to Ref/RelRef 2017-04-04 23:09:01 +02:00
permalinks.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
permalinks_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
prune_resources.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
robotstxt_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
rss_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
scratch.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
scratch_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
shortcode.go output: Support templates per site/language 2017-07-04 09:12:44 +02:00
shortcode_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
shortcodeparser.go Remove the goroutines from the shortcode lexer 2017-12-07 23:08:25 +01:00
shortcodeparser_test.go all: Refactor to nonglobal Viper, i18n etc. 2017-02-17 17:15:26 +01:00
site.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_benchmark_test.go Use StopTimer in site benchmarks 2017-12-05 16:17:11 +01:00
site_output.go Run gofmt to get imports in line vs gohugoio/hugo 2017-06-13 19:12:10 +02:00
site_output_test.go tpl/tplimpl: Fix escaped HTML Go 1.9 multioutput issue (#3880) 2017-09-13 12:32:06 +02:00
site_render.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_sections.go hugolib: Simplify Page.Eq 2017-08-17 09:43:39 +02:00
site_sections_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_stats_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
site_url_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
siteJSONEncode_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
sitemap.go hugolib: Fix some more Golint warnings 2016-03-23 10:10:28 +01:00
sitemap_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
taxonomy.go hubolib: Embed Page in WeightedPage 2017-05-09 23:58:25 +02:00
taxonomy_test.go hugolib: Add some more taxonomy permalinks test cases 2017-11-07 23:42:47 +01:00
template_engines_test.go Fix broken shortcodes for Ace and Amber 2017-11-18 10:41:31 +01:00
template_test.go all: Update import paths to gohugoio/hugo 2017-06-13 18:42:45 +02:00
testhelpers_test.go Implement Page bundling and image handling 2017-12-27 18:44:47 +01:00
translations.go hugolib: Fix .IsTranslated with identical filenames 2017-11-17 19:46:32 +01:00