Commit graph

488 commits

Author SHA1 Message Date
Bjørn Erik Pedersen 72903be587
commands: Make sure all language homes are always re-rendered in fast render mode
Fixes #4125
2017-12-29 09:37:37 +01:00
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
hugoreleaser 8a8ba63c7e releaser: Prepare repository for 0.32-DEV
[ci skip]
2017-11-27 11:27:33 +00:00
hugoreleaser aa68205d16 releaser: Bump versions for release of 0.31.1
[ci skip]
2017-11-27 11:26:08 +00:00
Bjørn Erik Pedersen 8afd7d9ceb commands: Fix broken --appendPort=false
Also make sure to log the correct server URL to the console.

Fixes #4111
2017-11-24 11:29:01 +01:00
hugoreleaser f4b416bbef releaser: Bump versions for release of 0.31
[ci skip]
2017-11-20 10:28:21 +00:00
Bjørn Erik Pedersen 60dfb9a6e0 Add support for multiple staticDirs
This commit adds support for multiple statDirs both on the global and language level.

A simple `config.toml` example:

```bash
staticDir = ["static1", "static2"]
[languages]
[languages.no]
staticDir = ["staticDir_override", "static_no"]
baseURL = "https://example.no"
languageName = "Norsk"
weight = 1
title = "På norsk"

[languages.en]
staticDir2 = "static_en"
baseURL = "https://example.com"
languageName = "English"
weight = 2
title = "In English"
```

In the above, with no theme used:

the English site will get its static files as a union of "static1", "static2" and "static_en". On file duplicates, the right-most version will win.
the Norwegian site will get its static files as a union of "staticDir_override" and "static_no".

This commit also concludes the Multihost support in #4027.

Fixes #36
Closes #4027
2017-11-17 11:01:46 +01:00
Bjørn Erik Pedersen 2e0465764b Add multilingual multihost support
This commit adds multihost support when more than one language is configured and `baseURL` is set per language.

Updates #4027
2017-11-17 11:01:46 +01:00
Bjørn Erik Pedersen bb048d811d
Use ms precision for static change logging 2017-11-15 08:52:29 +01:00
hugoreleaser 1d52bfbb47 releaser: Prepare repository for 0.31-DEV
[ci skip]
2017-10-19 11:35:38 +00:00
hugoreleaser bf633ea2f2 releaser: Bump versions for release of 0.30.2
[ci skip]
2017-10-19 11:34:09 +00:00
Bjørn Erik Pedersen 3164103310
commands: Support Fast Render mode with sub-path in baseURL
Fixes #3981
2017-10-19 10:09:04 +02:00
hugoreleaser bc53cd7b15 releaser: Prepare repository for 0.31-DEV
[ci skip]
2017-10-19 05:43:34 +00:00
hugoreleaser 89a3f47a21 releaser: Bump versions for release of 0.30.1
[ci skip]
2017-10-19 05:41:50 +00:00
Bjørn Erik Pedersen fa53b13ca0
Fix hugo -w
Fixes #3980
2017-10-18 18:35:25 +02:00
hugoreleaser 811f381e23 releaser: Bump versions for release of 0.30
[ci skip]
2017-10-16 08:39:00 +00:00
Bjørn Erik Pedersen 60bd332c1f Only re-render the view(s) you're working on
Hugo already, in its server mode,  support partial rebuilds. To put it simply: If you change `about.md`, only that content page is read and processed, then Hugo does some processing (taxonomies etc.) and the full site is rendered.
This commit covers the rendering part: We now only re-render the pages you work on, i.e. the last n pages you watched in the browser (which obviously also includes the  page in the example above).

To be more specific: When you are running the hugo server in watch (aka. livereload) mode, and change a template or a content file, then we do a partial re-rendering of the following:

* The current content page (if it is a content change)
* The home page
* Up to the last 10 pages you visited on the site.

This should in most cases be enough, but if you navigate to something completely different, you may see stale content. Doing an edit will then refresh that page.

Note that this feature is enabled by default. To turn it off, run `hugo server --disableFastRender`.

Fixes #3962
See  #1643
2017-10-14 13:40:43 +02:00
Michael Henderson 15ec031d98 Add correct config file name to verbose server log
Server logging uses the wrong variable when displaying
the configuration file name. This update changes the
log to use the `config` variable.
2017-10-10 07:47:35 +02:00
Bjørn Erik Pedersen 5800a20a25 metrics: Detect partialCached candidates
This commit adds a "cache potential" column when running `hugo --templateMetrics --templateMetricsHints`.

This is only calculated when `--templateMetricsHints` is set, as these calculations has an negative effect on the other timings.

This gives a value for partials only, and is a number between 0-100 that indicates if `partial` can be replaced with `partialCached`.

100 means that all execution of the same partial resulted in the same output.

You should do  some manual research before going "all cache".
2017-10-07 18:00:07 +02:00
hugoreleaser 396759a09b releaser: Bump versions for release of 0.29
[ci skip]
2017-09-26 19:23:15 +00:00
Cameron Moore b4a14c25fe metrics: Add simple template metrics feature 2017-09-26 20:03:04 +02:00
Bjørn Erik Pedersen e94d4f0177 commands: Make noHTTPCache default false
The other way was a mistake.
2017-09-26 19:59:15 +02:00
hugoreleaser 9e850c1f64 releaser: Bump versions for release of 0.28
[ci skip]
2017-09-25 07:59:12 +00:00
Bjørn Erik Pedersen fb33d8286d Use Chroma as new default syntax highlighter
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config.

Fixes #3888
2017-09-25 08:59:02 +02:00
Bjørn Erik Pedersen 80c7ea60a0 Make noHTTPCache default on
This is a development server, so that makes the most sense.

See #3897
2017-09-23 21:17:51 +02:00
Bjørn Erik Pedersen b180477631 Add liveReloadPort flag to server
This makes live reloading behind a HTTPS proxy working, as in the example below using the service from https://ngrok.com:

```
hugo server -b https://ba6sdfe72.ngrok.io --appendPort=false --liveReloadPort=443 --navigateToChanged
```

Fixes #3882
2017-09-23 17:08:48 +02:00
Bjørn Erik Pedersen 173b544982 commands: Remove superflous space 2017-09-22 20:05:19 +02:00
Bjørn Erik Pedersen df411ec81a commands: Rename noHttpCache to noHTTPCache 2017-09-22 17:23:15 +02:00
Bjørn Erik Pedersen 0b34af2161 Add noHttpCache to hugo server
Fixes #3897
2017-09-22 17:13:21 +02:00
hugoreleaser 5c3b210368 releaser: Prepare repository for 0.28-DEV
[ci skip]
2017-09-13 13:13:28 +02:00
hugoreleaser 18126434f1 releaser: Bump versions for release of 0.27.1
[ci skip]
2017-09-13 11:03:59 +00:00
hugoreleaser 828eb70fa6 releaser: Bump versions for release of 0.27
[ci skip]
2017-09-11 05:32:02 +00:00
Bjørn Erik Pedersen d2249c5099 Set up Hugo release flow on CircleCI
This rewrites the release logic to use CircleCI 2.0 and its approve workflow in combination with the state of the release notes to determine what to do next.

Fixes #3779
2017-09-10 17:14:02 +02:00
Bjørn Erik Pedersen b36f6e31e0 releaser: Bump versions for release of 0.26
[ci skip]
2017-08-07 09:05:07 +02:00
Max Rydahl Andersen aee2b06780 Add --debug option to be improved on over time
Why:

 * first time using hugo I got very little info from --verbose output
   but I noticed there is quite a lot of useful DEBUG logging
 * asked for in other issues like https://github.com/gohugoio/hugo/issues/3514

This change addreses the need by:

 * adding a simple --debug flag which simply turns on debug level in stdout
   and logoutput if enabled.
2017-07-27 22:36:22 +02:00
Bjørn Erik Pedersen 91f410ea90 Bump versions to 0.26-DEV 2017-07-10 09:16:02 +02:00
Bjørn Erik Pedersen aded65b71d releaser: Prepare repository for 0.25-DEV
[ci skip]
2017-07-10 09:02:20 +02:00
Bjørn Erik Pedersen 0e09be7b3c releaser: Bump versions for release of 0.25.1
[ci skip]
2017-07-10 08:57:34 +02:00
Vasiliy Solovey 7bcc1ce659 commands: Navigate to changed on CREATE
When working with content from IntelliJ IDE,
like WebStorm, every file save is followed by
two events: "RENAME" and then "CREATE".
2017-07-08 09:37:24 +02:00
Bjørn Erik Pedersen 6e086e3d03 releaser: Bump versions for release of 0.25
[ci skip]
2017-07-07 09:23:54 +02:00
Bjørn Erik Pedersen 75f782f035 Revert "commands: Adjust docs path"
This reverts commit 729be8074b.
2017-07-06 10:34:04 +02:00
Bjørn Erik Pedersen 5f831a6223 releaser: Replace the magic version handling
Take the new version as a string value.
2017-07-05 14:27:43 +02:00
Bjørn Erik Pedersen e7a54e7afc releaser: Add --try flag to ease testing 2017-07-05 14:27:43 +02:00
Victor Kropp 1039356edf commands: Support human-readable YAML boolean values in undraft 2017-07-03 23:26:01 +02:00
coderzh 7ee1f25e9e hugo import jekyll support nested _posts directories
Fixes #1890
Closes #1911
2017-07-01 10:15:22 +02:00
Anthony Fok 30e14cc316 Make --navigateToChanged more robust on Windows
This ensures the new "open 'current content page' in browser" works
on Windows, especially with Emacs and Vim.

Special thanks to @bep for coming up with the idea of the fix.

See #3645
2017-06-27 11:45:54 +02:00
Bjørn Erik Pedersen c825a73121 Support open "current content page" in browser
This commit adds a new `--navigateToChanged` and config setting with the same name, that, when running the Hugo server with live reload enabled, will navigate to the current content file's URL on save. 

This is really useful for site-wide content changes (copyedits etc.).
Fixes #3643
2017-06-26 21:34:16 +02:00
Anthony Fok aff1ac3235 commands: Use example.com as homepage for new theme
The fictional siteforthistheme.com domain has been
squatted by Afternic of GoDaddy since November 2016...
2017-06-26 12:38:45 -06:00
Bjørn Erik Pedersen fd924d1802 commands: Create default archetype on new site
See #3626
2017-06-22 22:00:42 +02:00
Bjørn Erik Pedersen 8f69fe57a4 releaser: Bump versions for release of 0.24
[ci skip]
2017-06-21 13:52:27 +02:00