Bjørn Erik Pedersen [Tue, 13 Feb 2018 20:45:51 +0000 (21:45 +0100)]
resource: Fix multi-threaded image processing issue
When doing something like this with the same image from a partial used in, say, both the home page and the single page:
```bash
{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := $big.Resize "512x" }}
{{ end }}
```
There would be timing issues making Hugo in some cases try to process the same image with the same instructions in parallel.
You would experience errors of type:
```bash
png: invalid format: not enough pixel data
```
This commit works around that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work.
The current workaround before this fix is to always operate on the original:
```bash
{{ with $img }}
{{ $big := .Fill "1024x512 top" }}
{{ $small := .Fill "512x256 top" }}
{{ end }}
```
Fixes #4404
Bjørn Erik Pedersen [Tue, 13 Feb 2018 08:14:44 +0000 (09:14 +0100)]
resource: Improve error processing error message
Bjørn Erik Pedersen [Tue, 13 Feb 2018 08:01:47 +0000 (09:01 +0100)]
hugolib: Improve error message in .Render
Bjørn Erik Pedersen [Mon, 12 Feb 2018 17:47:25 +0000 (18:47 +0100)]
parser: Add WARNING for integer YAML keys
```bash
benchmark old ns/op new ns/op delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 3053 2015 -34.00%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 5.23 5.18 -0.96%
BenchmarkStringifyMapKeysIntegers-4 2320 5177 +123.15%
benchmark old allocs new allocs delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 6 6 +0.00%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00%
BenchmarkStringifyMapKeysIntegers-4 6 14 +133.33%
benchmark old bytes new bytes delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 1008 1008 +0.00%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00%
BenchmarkStringifyMapKeysIntegers-4 1008 1776 +76.19%
```
Closes #4393
Bjørn Erik Pedersen [Mon, 12 Feb 2018 16:39:11 +0000 (17:39 +0100)]
parser: Tune stringifyMapKeys
```bash
benchmark old ns/op new ns/op delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 3269 3053 -6.61%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 4.79 5.23 +9.19%
BenchmarkStringifyMapKeysIntegers-4 2707 2320 -14.30%
benchmark old allocs new allocs delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 16 6 -62.50%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00%
BenchmarkStringifyMapKeysIntegers-4 16 6 -62.50%
benchmark old bytes new bytes delta
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 1080 1008 -6.67%
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4 0 0 +0.00%
BenchmarkStringifyMapKeysIntegers-4 1080 1008 -6.67%
```
Bjørn Erik Pedersen [Mon, 12 Feb 2018 16:32:42 +0000 (17:32 +0100)]
parser: Rename stringifyYAMLMapKeys to stringifyMapKeys
Bjørn Erik Pedersen [Mon, 12 Feb 2018 16:31:37 +0000 (17:31 +0100)]
parser: Add benchmarks for stringifyYAMLMapKeys
```bash
BenchmarkStringifyMapKeysStringsOnlyInterfaceMaps-4 500000 3269 ns/op 1080 B/op 16 allocs/op
BenchmarkStringifyMapKeysStringsOnlyStringMaps-4
300000000 4.79 ns/op 0 B/op 0 allocs/op
BenchmarkStringifyMapKeysIntegers-4 500000 2707 ns/op 1080 B/op 16 allocs/op
```
Vas Sudanagunta [Mon, 12 Feb 2018 00:10:49 +0000 (19:10 -0500)]
Add support for YAML array data files
* Unmarshaled YAML arrays indistinguishable from JSON arrays.
* Fixes #3890
Vas Sudanagunta [Sun, 11 Feb 2018 23:34:03 +0000 (18:34 -0500)]
Account for array type data in data dir merge/override logic
* Fixes #4366
* Error message to console for unsupported data types
Vas Sudanagunta [Sun, 11 Feb 2018 21:27:47 +0000 (16:27 -0500)]
hugolib: Refactor tests for JSON, YAML and TOML equivalency, add coverage
The same code now cycles through equivalent JSON, YAML and TOML data sets,
verifying output both proper and identical. Coverage increased by applying
previous tests for one format to the others.
More DRY. Added tests for numeric and bool value types.
Vas Sudanagunta [Sun, 11 Feb 2018 20:38:33 +0000 (15:38 -0500)]
hugolib: Re-enable YAML data tests disabled in
f554503f
Also gave basic tests for JSON, YAML and TOML identical inputs and expected outputs, a step toward JSON, YAML and TOML equivalency (see https://github.com/gohugoio/hugo/issues/4393#issuecomment-
364437785).
Bjørn Erik Pedersen [Sat, 10 Feb 2018 11:52:31 +0000 (12:52 +0100)]
Bjørn Erik Pedersen [Sat, 10 Feb 2018 11:51:31 +0000 (12:51 +0100)]
Squashed 'docs/' changes from
2fc775dec..
f97826a17
f97826a17 Merge commit '
12ecbf4a1b05c2794281f47909c836b1a005bc19'
12ecbf4a1 Squashed 'themes/gohugoioTheme/' changes from
ecad8247..
fe71e360
aaa7ac214 Ignore .DS_Store files
0e023ca12 Remove comments in showcase front matter
f3ba5ac87 Hartwell Insurance showcase
47aefdbda Remove unnecessary duplicated words
612693b4f Some minor language fixes
a833ba15b Spelling
5972e70a9 Revert "showcase: Even smaller file"
3479b975e showcase: Even smaller file
2272e0b83 showcase: Reduce image size
718c3c3e5 Spelling
0b954eccb showcase: Pace copy-edits
baded8064 showcase: Pace
842c1cedf Add a Showcase copyright notice
c5963edaa Update installing
4fa0b0d73 Add link to showcase template
d0f303916 Add some showcase guide content
c809789b1 Add srcset to the showcase screenshots
49d875904 Start of a template
1153de221 Clean resouerces
69f00df4c Remove the showcases
653ad5bcd Add a simple byline
c5342b5e5 Regenerate image after rebase
b80669b34 Bump version in config.toml
cd5c79c67 Fix an issue where whitespace wrap caused scrollbars on some browsers
f00547e98 Add section to the title element
aa10defed Iterating on Showcase (#330)
76a0bfbc3 Add some dummy content to some of the showcase pages
66f68964d Standardize showcase metadata
627ffa6d4 Adjust showcase image size on front page
cbc3efece Redo some showcase images
054b54cb6 Use .RelPermalink and not .URL
82ba5f1c6 Add resources
d1415795b Move showcase items in list view to a template in the layout
f34620e90 Tweak details box for mobile
df6a0bf24 Include images that changed from the column shift
02036581f Improve showcase single layout
5f7730c89 Improve styling of showcase prev/next buttons
a2b2f7731 Remove extra div that was breaking mobile layout of the showcase
b172fe5f4 Add block class to to images on mobile so they behave as expected
a4ebfec86 Add a proper RSS feed to home page
0524479e0 Move showcase images to proper Resources
0544b57df Convert showcase pages to bundles
8febaab2b Add Showcase to Home page and internal pages
26d1f4542 Fix baseURL in Netlify deploy previews
046497616 Revert "Try to fix the Netlify preview baseURL setup"
80dce17ca Revert "Add some temporary baseURL debug"
8617e8692 Add some temporary baseURL debug
371e56bce Try to fix the Netlify preview baseURL setup
1b70b3f18 Add Netlify CMS to Frontends list
d6184e71d Fix menu for "What is Hugo" page
1ae83ad3e Fix mobile menu display so it shows on mid-size displays
f60e1f750 Edited slight typo, added "of"
56b906667 Fix typo
c5bea5cbd Release 0.36
00539094e releaser: Prepare repository for 0.37-DEV
b222cbdf2 releaser: Add release notes to /docs for release of 0.36
e59d1d766 releaser: Bump versions for release of 0.36
9620aa002 docs: Add documentation for smart cropping etc.
91c3801f1 Merge commit '
c305e44f5f081e4436195923a4593e396f07cd49'
8e71ff60b releaser: Prepare repository for 0.36-DEV
git-subtree-dir: docs
git-subtree-split:
f97826a17209fe3e153b7f5bbf69c511e4e13203
Bjørn Erik Pedersen [Fri, 9 Feb 2018 08:21:46 +0000 (09:21 +0100)]
tpl/transform: Add template func for TOML/JSON/YAML docs examples conversion
Usage:
```html
{{ "title = \"Hello World\"" | transform.Remarshal "json" | safeHTML }}
```
Fixes #4389
Kaushal Modi [Mon, 5 Feb 2018 19:06:29 +0000 (14:06 -0500)]
Add "target" and "rel" parameters to figure shortcode
Also:
- Remove unnecessary space from `figure` tag if no class is specified.
- Update related tests.
- Add test cases for the changes made to the figure shortcode.
- Document the newly added target and rel parameters
- Add more detail to the documentation of all figure shortcode parameters.
Kaushal Modi [Thu, 8 Feb 2018 21:32:49 +0000 (16:32 -0500)]
Use more canonical "twitter:image" property, not "twitter:image:src"
This change is made in the "twitter_cards" internal template.
References:
- https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary-card-with-large-image
- https://twittercommunity.com/t/twitter-image-src-or-twitter-image/16085/7
Bjørn Erik Pedersen [Fri, 9 Feb 2018 11:32:45 +0000 (12:32 +0100)]
hugolib: Temp. disable some YAML data tests
They fail.
We will have to think about this.
See #4393
Dawid Gaweł [Fri, 1 Dec 2017 19:37:19 +0000 (20:37 +0100)]
parser: Fix YAML maps key type
Recurse through result of yaml package parsing and change all
maps from map[interface{}]interface{} to map[string]interface{}
making them jsonable and sortable.
Fixes #2441, #4083
Bjørn Erik Pedersen [Thu, 8 Feb 2018 18:25:02 +0000 (19:25 +0100)]
releaser: Update to Go 1.9.4
Bjørn Erik Pedersen [Wed, 7 Feb 2018 20:45:53 +0000 (21:45 +0100)]
Bump Travis/Snapcraft to Go 1.9.4
hugoreleaser [Mon, 5 Feb 2018 15:24:52 +0000 (15:24 +0000)]
releaser: Prepare repository for 0.37-DEV
[ci skip]
hugoreleaser [Mon, 5 Feb 2018 15:22:26 +0000 (15:22 +0000)]
releaser: Add release notes to /docs for release of 0.36
[ci skip]
hugoreleaser [Mon, 5 Feb 2018 15:22:26 +0000 (15:22 +0000)]
releaser: Bump versions for release of 0.36
[ci skip]
Bjørn Erik Pedersen [Mon, 5 Feb 2018 15:10:16 +0000 (16:10 +0100)]
Release 0.336
hugoreleaser [Mon, 5 Feb 2018 14:56:39 +0000 (14:56 +0000)]
releaser: Add release notes draft for 0.36
Rename to *-ready.md to continue. [ci skip]
Bjørn Erik Pedersen [Mon, 5 Feb 2018 14:04:07 +0000 (15:04 +0100)]
docs: Add documentation for smart cropping etc.
Bjørn Erik Pedersen [Mon, 5 Feb 2018 13:24:24 +0000 (14:24 +0100)]
Bjørn Erik Pedersen [Mon, 5 Feb 2018 13:24:00 +0000 (14:24 +0100)]
Squashed 'docs/' changes from
dce236ad1..
2fc775dec
2fc775dec Fix allLanguages code
dc6bfbedb Fix header level
6d652458c Fixed typo in docs.
2da6518be Fix broken build in previous commit
eabe7a40b Move some release notes to bundles to test the resource setup
34f2a41f2 Add featured image to news articles
bba1104b8 Update index.md
62bb8d826 Bundless > bundles
afea67773 Release notes spelling
f66d13af2 Release Hugo 0.35
613c50cdd releaser: Add release notes to /docs for release of 0.35
c9f7fd637 releaser: Bump versions for release of 0.35
360296c34 docs: Regenerate CLI docs
0d688633f Merge commit '
337d0c5f516ee085205e8abefdb7f87e6d33ca05'
8fc9e325b command: Remove undraft command
f8cc6d51f docs: Re-generate CLI docs
556ea887a releaser: Prepare repository for 0.35-DEV
git-subtree-dir: docs
git-subtree-split:
2fc775dece2c5a76aaa3855b6dd054fd74c8738d
Bjørn Erik Pedersen [Sat, 3 Feb 2018 15:47:35 +0000 (16:47 +0100)]
resource: Add smart cropping
This commit `smart` as a new and default anchor in `Fill`.
So:
```html
{{ $image.Fill "200x200" }}
```
Is, with default configuration, the same as:
```html
{{ $image.Fill "200x200" "smart" }}
```
You can change this default in your `config.toml`:
```toml
[imaging]
[imaging]
resampleFilter = "box"
quality = 68
anchor = "Smart"
```
Fixes #4375
Cameron Moore [Mon, 5 Feb 2018 04:13:52 +0000 (22:13 -0600)]
tpl: Ensure site templates can override theme templates
The tplimpl package was misusing the TemplateLookupDescriptor.WorkingDir
field from the output package. By incorrectly setting it to the theme
directory instead of the site root, the user is unable to override theme
templates in some situations.
Fixes #3505
Cameron Moore [Mon, 5 Feb 2018 04:09:14 +0000 (22:09 -0600)]
hugolib: Add additional test to TestTemplateLookupOrder
Add an additional test to "Variant 4, theme, use site base" to also test
for the index.html base (from by testing of #3505). Also add a "name"
field to the test cases to make it easier to know which test is failing
versus just getting a slice index.
Cameron Moore [Mon, 5 Feb 2018 04:04:40 +0000 (22:04 -0600)]
hugolib: Fix broken TestTemplateLookupOrder
It looks like we left some debugging code in place that caused all but
one test case to run.
Vas Sudanagunta [Fri, 2 Feb 2018 06:35:26 +0000 (01:35 -0500)]
Fix JSON array-based data file handling regression
This bug was introduced in Hugo 0.35.
Fixes #4361
Vas Sudanagunta [Fri, 2 Feb 2018 06:28:24 +0000 (01:28 -0500)]
Increase data directory test coverage
* Adds retro-coverage for #4361
* Verifies open issues #4138, #3890, #4366, 4083
* Removes test reliance on the very code it is testing (hugo/parser package).
Expected results are now all built manually / are more precise.
Tests can run against different versions (no linkage errs)
hugoreleaser [Wed, 31 Jan 2018 10:47:09 +0000 (10:47 +0000)]
releaser: Prepare repository for 0.36-DEV
[ci skip]
hugoreleaser [Wed, 31 Jan 2018 10:44:41 +0000 (10:44 +0000)]
releaser: Add release notes to /docs for release of 0.35
[ci skip]
hugoreleaser [Wed, 31 Jan 2018 10:44:41 +0000 (10:44 +0000)]
releaser: Bump versions for release of 0.35
[ci skip]
Bjørn Erik Pedersen [Wed, 31 Jan 2018 10:41:19 +0000 (11:41 +0100)]
Release 0.35
Bjørn Erik Pedersen [Wed, 31 Jan 2018 10:40:30 +0000 (11:40 +0100)]
docs: Regenerate CLI docs
hugoreleaser [Wed, 31 Jan 2018 10:13:23 +0000 (10:13 +0000)]
releaser: Add release notes draft for 0.35
Rename to *-ready.md to continue. [ci skip]
Bjørn Erik Pedersen [Wed, 31 Jan 2018 10:08:08 +0000 (11:08 +0100)]
Bjørn Erik Pedersen [Wed, 31 Jan 2018 10:07:47 +0000 (11:07 +0100)]
Squashed 'docs/' changes from
56c34962c..
dce236ad1
dce236ad1 Wrap up the bundle etc. edits for now
27d058566 Add the bundle tree to the organization bundle
a83f750dd Move organization.md to its own bundle
01ec4f462 Make the image docs a bundle
60de1e090 Some more resources copy-edits
05d763c0c Some resource copy-edits
6299d6dbb Update the imgproc shortcode
59e0fc209 Add headless bundle documentation
a3bbf60bf Link Page Resources page from Front Matter page
830576f86 Update order significance section, add counter section
3b1836509 Revert the recent change made to default list template
886ed0e10 Page Bundles draft rev 2
f530d1a7a image processing and page resources made into regular .md
ec47cecda Finalised Page Resources and Image Processing Moved Page Resources and Impage Processing out of the Bundle section and at the root of the Content Management section
253092335 Modified front matter metadata exemple. Added yaml version.
da5e4f476 Adding date in the front-matter; missed in previous commit
6bc3ced13 Add rough draft for page and section bundles
a0e44458f Image processing first draft, Resources second read/fix
2367f0b78 data: Remove duplicate layouts in table
c2f179839 First draft of bundles/resources (covers resources and metadata)
2a3f9a613 Add weights to pages in Bundles branch
9a0146cc0 Switch front-matter format of Bundles doc to yaml; add front-matter
1295fc083 First draft for Bundles documentation organization structure
5a2e52231 Fix archetype paths
9c2e5c063 Merge commit '
22cced34fc608256f8271ad591a5ccca991bb164'
22cced34f Squashed 'themes/gohugoioTheme/' changes from
75da2f6b..
ecad8247
55d16c9a1 Fix broken sentence in multilingual sections
a76895ad2 Replace the outdated Emacs package with new one
e6cf1dec0 Remove obsolete link to hugo roadmap
dd2fd145b Add GitLab Pages to mentioned hosters (#309)
a05ce6bf6 Add 0.34 release notes poster
5c0ebdfca Release 0.34
13c2f3dc8 Merge branch 'temp34'
e6b5ffa04 Add 0.34 poster
1e1960496 releaser: Add release notes to /docs for release of 0.34
ac3efe182 releaser: Bump versions for release of 0.34
8f91f62d8 Fixes #222
cca35dbe4 Fix example
eaaa21ca1 Add missing params key
00d0b0363 Adding new Blogger utility to tools/migrations
7d36d579e Updated the line number for Dockerfile pointer
852188f85 Update installing.md with Fedora instructions
4d151a3ab Update search.md
4c2750bfb Update deployment-with-nanobox.md
c3cc9cd49 configuration: Remove defaultExtension from docs
f7c96b4b5 Update GitHub Pages documentation
55787f09a Merge branch 'rmetzler-menu-link-title'
2abbd9bd9 Merge branch 'master' into menu-link-title
e1fd710b7 Bring archetypes in from theme.
daf6f51c0 Mention the significance of leading 0 in int fn string input
07f498755 Add documentation for `cond` function.
050ccd12b Add documentation for the .HasShortcode function
919af9071 Correct anchor under 'Add custom metadata to a Taxonomy Term'
55600b4ff More layouts work
201cf4f67 Add some more single page layout variants
d5e7c03e2 Rework the layouts doc
84622e67c Cleans up the code sample
c231c9bd5 Add a new note to 0.33 relnotes
328ec9930 Release 0.33
b108fcc7b Merge branch 'temp33' into next
ab9d9ee65 releaser: Prepare repository for 0.34-DEV
e20c75320 releaser: Add release notes to /docs for release of 0.33
49f24dcd1 releaser: Bump versions for release of 0.33
9c8e5e207 Update 0.33 poster
7655603c8 Regenerate the docshelper data
16dc99583 Add Hugo 0.33 poster
ce40cc197 Merge commit '
3cf4300097610bb8b5bd0686d96d1df5db641895'
9a3085523 releaser: Prepare repository for 0.33-DEV
a52db97d8 fixing typos and syntax for consistency
64525670f ádd title to some menu entries. This needs hugo >= v0.32
85d415ab2 ádd examples for menu .Title and .Page
git-subtree-dir: docs
git-subtree-split:
dce236ad1258a9d9a0ee209f02b2e1f65b46f0fb
Anthony Fok [Wed, 31 Jan 2018 09:00:16 +0000 (02:00 -0700)]
Add "removable-media" interface to snapcraft.yaml
Closes #3837
Ryan Skoblenick [Wed, 31 Jan 2018 06:33:03 +0000 (01:33 -0500)]
Fix Docker build
The present Dockerfile in master does not build a Hugo container. The
build container prematurely exits because `dep ensure` can not locate
`Gopkg.toml` due to the source files not being copied/added to the
container prior to running this command. The minimal change require
to resolve the issue is merely move the ADD source before the RUN dep.
Fixes #4076
Resolves #4077
Bjørn Erik Pedersen [Tue, 30 Jan 2018 18:56:29 +0000 (19:56 +0100)]
readme: Update list of "builders" to include myself
Bjørn Erik Pedersen [Tue, 30 Jan 2018 16:51:18 +0000 (17:51 +0100)]
Fix language params handling
This fixes some issues with language params handling by separating params from configuration values per language.
This means that you can now do this:
```toml
[languages]
[languages.en]
languageName = "English"
weight = 1
title = "My Cool Site"
[languages.en.params]
myParam = "Hi!"
```
This is not a breaking change, but the above is a less suprising way of configuring custom params.
It also fixes some hard-to-debug corner-cases in multilingual sites.
Fixes #4356
Fixes #4352
Bjørn Erik Pedersen [Tue, 30 Jan 2018 09:47:38 +0000 (10:47 +0100)]
commands: Remove some now superflous Fast Render Mode code
Updates #4339
Bjørn Erik Pedersen [Tue, 30 Jan 2018 09:33:57 +0000 (10:33 +0100)]
hugolib: Extract the Fast Render Mode logic into a method
This also improves on the previous commit as it takes pages without content files into account.
Closes #4339
Alexey Grachov [Sun, 28 Jan 2018 10:46:48 +0000 (12:46 +0200)]
hugolib: Handle newly created files in Fast Render Mode
Updates #4339
Robert Basic [Mon, 29 Jan 2018 15:21:42 +0000 (16:21 +0100)]
command: Remove undraft command
According to @bep, it is easier to undraft content by
editing manually the frontmatter of said content by
setting the draft flag to `false`, or removing it completely,
than to rely on the undraft command which is a source of
many bugs.
Fixes #4353
Bjørn Erik Pedersen [Mon, 29 Jan 2018 13:07:46 +0000 (14:07 +0100)]
commands: Mark deprecated flags in the CLI help
See #4347
Bjørn Erik Pedersen [Mon, 29 Jan 2018 12:52:04 +0000 (13:52 +0100)]
hugolib: Deprecate useModTimeAsFallback
Fixes #4351
Bjørn Erik Pedersen [Mon, 29 Jan 2018 10:44:41 +0000 (11:44 +0100)]
tpl: Update Twitter card to also consider images in .Resources
The new lookup order:
1) Page.Params.images if set
2) Image resources: images with name "feature" (priority), "cover", "thumbnail"
3) Site.Params.images if set
Fixes #4349
Bjørn Erik Pedersen [Mon, 29 Jan 2018 09:44:09 +0000 (10:44 +0100)]
resource: Make resource counters for name and title independent
This is the most flexible with the current syntax, and probably what most people would expcect.
Updates #4335
Bjørn Erik Pedersen [Sun, 28 Jan 2018 18:38:10 +0000 (19:38 +0100)]
create: Provide .Name to the archetype templates
This value will have a better suited value to base the titles on in your archetype templates when creating bundle ´index.md` type of files.
The internal template is updates, but you will have to update any custom archetype template to use the new `.Name` variable:
```bash
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---
```
Fixes #4348
Bjørn Erik Pedersen [Sun, 28 Jan 2018 16:22:08 +0000 (17:22 +0100)]
commands: Deprecate CLI flags canonifyURLs, pluralizeListTitles, preserveTaxonomyNames, uglyURLs
You can of course still set them in site config.
Fixes #4347
Bjørn Erik Pedersen [Sun, 28 Jan 2018 16:03:10 +0000 (17:03 +0100)]
hugolib: Fix --uglyURLs from comand line regression
This bug was introduced in Hugo 0.33.
Fixes #4343
Colin Seymour [Thu, 11 Jan 2018 16:42:49 +0000 (16:42 +0000)]
Only set 'url' if permalink in metadata and remove duplicate confirm msg
The current behaviour addes a `url` attribute to the frontmatter of all posts imported from Jeklly and assumes the desired permalink structure is /:year/:month/:day/:title/. This may be the case for most peeps, but poses a problem for those that don't use this permalink structure as the `url` attribute takes precedence over the `permalink` attribute in the site-wide configuration meaning it can't be overruled.
This changes the behaviour to only set the `url` attribute if the `permalink` attribute is set in the Jekyll frontmatter.
The duplication of the confirmation message is also removed.
Tests have been updated to reflect this change in behaviour.
Fixes #1887
Bjørn Erik Pedersen [Sat, 27 Jan 2018 17:03:06 +0000 (18:03 +0100)]
Fix handling of top-level page bundles
Fixes #4332
liguoqinjim [Sat, 27 Jan 2018 17:51:12 +0000 (01:51 +0800)]
tpl/collections: Seed random on init only
Bjørn Erik Pedersen [Sat, 27 Jan 2018 09:58:30 +0000 (10:58 +0100)]
commands: Fix baseURL server regression for multilingual sites
This was introduced in
6413559f7575e2653d76227a8037a7edbaae82aa a couple of days ago, and demonstrates that we really need better tests for the server/commands package.
Fixes #4333
Bjørn Erik Pedersen [Sat, 27 Jan 2018 09:22:42 +0000 (10:22 +0100)]
resource: Start Resources :counter first time they're used
This is less surprising and more flexible than the original implementation.
Given:
```toml
[[resources]]
src = "documents/photo_specs.pdf"
title = "Photo Specifications"
[[resources]]
src = "**.pdf"
name = "pdf-file-:counter"
```
Every `pdf` in the bundle will have an unique counter, but the `photo_specs.pdf` is still allowed to have its specific `title`.
If you change the above example to:
```toml
[[resources]]
src = "documents/*specs.pdf"
title = "Photo Specifications #:conter"
[[resources]]
src = "**.pdf"
name = "pdf-file-:counter"
```
We are talking about two different groups of documents, each with its own counters starting at 1.
Fixes #4335
Bjørn Erik Pedersen [Fri, 26 Jan 2018 16:08:32 +0000 (17:08 +0100)]
travis: Re-enable macOS builds
Bjørn Erik Pedersen [Fri, 26 Jan 2018 16:06:05 +0000 (17:06 +0100)]
Update to Go 1.9.3
Fixes #4328
Bjørn Erik Pedersen [Thu, 25 Jan 2018 16:03:29 +0000 (17:03 +0100)]
Add a way to disable one or more languages
This commit adds a new config setting:
```toml
disableLanguages = ["fr"]
```
If this is a multilingual site:
* No site for the French language will be created
* French content pages will be ignored/not read
* The French language configuration (menus etc.) will also be ignored
This makes it possible to start translating new languages and turn it on when you're happy etc.
Fixes #4297
Fixed #4329
Vas Sudanagunta [Fri, 26 Jan 2018 04:03:55 +0000 (23:03 -0500)]
Fix "date" page param
Add test coverage for all date type page params that shadow date type page variables.
Fixes #4323
Vas Sudanagunta [Fri, 26 Jan 2018 03:54:15 +0000 (22:54 -0500)]
Support pages without front matter
* Page without front matter now treated same as a page with empty front matter.
* Test cases added to cover this and repro issue #4320.
* Type safety of front matter code improved.
Fixes #4320
Vas Sudanagunta [Wed, 24 Jan 2018 14:21:55 +0000 (09:21 -0500)]
Add page metadata dates tests
Bjørn Erik Pedersen [Thu, 25 Jan 2018 16:08:18 +0000 (17:08 +0100)]
hugolib: Remove unused code
Bjørn Erik Pedersen [Thu, 25 Jan 2018 09:36:53 +0000 (10:36 +0100)]
hugolib, output: Fix robots.txt in multihost mode
Fixes #4193
Bjørn Erik Pedersen [Thu, 25 Jan 2018 09:24:59 +0000 (10:24 +0100)]
docs: Re-generate CLI docs
Bjørn Erik Pedersen [Thu, 25 Jan 2018 08:58:55 +0000 (09:58 +0100)]
Remove and update deprecation status
Bjørn Erik Pedersen [Thu, 25 Jan 2018 08:37:05 +0000 (09:37 +0100)]
output: Remove duplicate layout lookup layouts
This can happen for sections if Type and Section are equal.
Of no real practical difference, but it makes the docs less confusing.
Fixes #4319
Bjørn Erik Pedersen [Wed, 24 Jan 2018 12:36:06 +0000 (13:36 +0100)]
hugolib: Add the last lookup variant for the GetPage index
Now, even for nun-bundles it is possible to do lookup without path or extension.
So, given `blog/my-blog-post.en.md` these lookups will succeed:
* `blog/my-blog-post.en.md`
* `blog/my-blog-post`
* `my-blog-post.en.md`
* `my-blog-post`
See #4312
See https://github.com/gohugoio/hugoDocs/issues/307
Bjørn Erik Pedersen [Wed, 24 Jan 2018 09:41:37 +0000 (10:41 +0100)]
github: Shorten the stale setup
Alexey Grachov [Wed, 24 Jan 2018 09:24:21 +0000 (11:24 +0200)]
resource: Fix typo in comment
Bjørn Erik Pedersen [Wed, 24 Jan 2018 08:47:30 +0000 (09:47 +0100)]
hugolib: Simplify bundle lookup via .Site.GetPage, ref, relref
Given a bundle in `blog/my-bundle/index.en.md` all of these will now worK:
* `blog/my-bundle/index.en.md`
* `blog/my-bundle/index`
* `blog/my-bundle`
* `my-bundle`
The last one is potentially ambigous.
Fixes #4312
Bjørn Erik Pedersen [Wed, 24 Jan 2018 08:08:26 +0000 (09:08 +0100)]
Add a GetPage to the site benchmarks
Bjørn Erik Pedersen [Tue, 23 Jan 2018 13:02:54 +0000 (14:02 +0100)]
Add headless bundle support
This commit adds support for `headless bundles` for the `index` bundle type.
So:
```toml
headless = true
```
In front matter means that
* It will have no `Permalink` and no rendered HTML in /public
* It will not be part of `.Site.RegularPages` etc.
But you can get it by:
* `.Site.GetPage ...`
The use cases are many:
* Shared media galleries
* Reusable page content "snippets"
* ...
Fixes #4311
Bjørn Erik Pedersen [Tue, 23 Jan 2018 09:02:44 +0000 (10:02 +0100)]
Merge matching resources params maps
This allows setting default params values in the more general resource matchers. I also allows override with more specific values if needed.
```toml
[[resources]]
src = "documents/photo_specs.pdf"
title = "Photo Specifications"
[resources.params]
ref =
90564687
icon = "photo"
[[resources]]
src = "documents/guide.pdf"
title = "Instruction Guide"
[resources.params]
ref =
90564568
[[resources]]
src = "documents/checklist.pdf"
title = "Document Checklist"
[resources.params]
ref =
90564572
[[resources]]
src = "documents/payment.docx"
title = "Proof of Payment"
[[resources]]
src = "documents/*.pdf"
title = "PDF file"
[resources.params]
icon = "pdf"
[[resources]]
src = "documents/*.docx"
title = "Word document"
[resources.params]
icon = "word"
```
In the above `TOML` example, `photo_specs.pdf` will get the `photo` icon, the other pdf files will get the default `pdf` icon.
Note that in the example above, the order matters: It will take the first value for a given params key, title or name that it finds.
Fixes #4315
Bjørn Erik Pedersen [Tue, 23 Jan 2018 12:33:51 +0000 (13:33 +0100)]
Add some general code contribution criterias
Bjørn Erik Pedersen [Tue, 23 Jan 2018 11:59:40 +0000 (12:59 +0100)]
travis: Disable macOS builds for now
Travis have not been able to build those the last week or so.
Bjørn Erik Pedersen [Tue, 23 Jan 2018 08:48:04 +0000 (09:48 +0100)]
helpers: Avoid unescape in highlight
Fixes #4219
Vas Sudanagunta [Sun, 21 Jan 2018 19:40:58 +0000 (14:40 -0500)]
Tighten page kind logic, introduce tests
hugoreleaser [Mon, 22 Jan 2018 12:08:54 +0000 (12:08 +0000)]
releaser: Prepare repository for 0.35-DEV
[ci skip]
hugoreleaser [Mon, 22 Jan 2018 12:06:38 +0000 (12:06 +0000)]
releaser: Add release notes to /docs for release of 0.34
[ci skip]
hugoreleaser [Mon, 22 Jan 2018 12:06:38 +0000 (12:06 +0000)]
releaser: Bump versions for release of 0.34
[ci skip]
Bjørn Erik Pedersen [Mon, 22 Jan 2018 11:58:55 +0000 (12:58 +0100)]
Release 0.34
hugoreleaser [Mon, 22 Jan 2018 10:40:52 +0000 (10:40 +0000)]
releaser: Add release notes draft for 0.34
Rename to *-ready.md to continue. [ci skip]
Bjørn Erik Pedersen [Mon, 22 Jan 2018 10:29:02 +0000 (11:29 +0100)]
resource: Avoid some strings.ToLower in globbing
See #4301
Bjørn Erik Pedersen [Mon, 22 Jan 2018 10:21:58 +0000 (11:21 +0100)]
releaser: Fix BuildDate in release binaries
Fixes #4299
Bjørn Erik Pedersen [Sat, 20 Jan 2018 17:07:41 +0000 (18:07 +0100)]
resource: Add Match and GetMatch
These methods takes a glob pattern as argument:
* by default matching from the bundle root
* matching is case insensitive and the separator is Unix style slashes: "/"
* the bundle root does (by default) not start with a leading slash
* if you renames the `Name` for the rsource in front matter (`src=...`), then that is the value used in `Match`.
* double asterisk matches beyond directory borders, so "**.jpg" will match any JPEG image in the bundle
See https://github.com/gobwas/glob
This commit also deprecates `ByPrefix` and `GetByPrefix`.
This should also be more effective, given a fair amount of reuse of the glob patterns:
```bash
BenchmarkResourcesByPrefix-4 300000 4284 ns/op 1130 B/op 7 allocs/op
BenchmarkResourcesMatch-4 300000 5220 ns/op 505 B/op 3 allocs/op
```
Fixes #4301
Bjørn Erik Pedersen [Sat, 20 Jan 2018 16:11:03 +0000 (17:11 +0100)]
hugolib: Fix handling of pages bundled in sub-folders in ByPrefix etc.
Fixes #4295
Bjørn Erik Pedersen [Fri, 19 Jan 2018 10:39:34 +0000 (11:39 +0100)]
output: Add some more layout docshelper variants
Bjørn Erik Pedersen [Fri, 19 Jan 2018 07:24:10 +0000 (08:24 +0100)]
hugolib: Add validation for defaultContentLanguage
When `languages` are defined, then `defaultContentLanguage` must match one of those.
Fixes #4298
hugoreleaser [Thu, 18 Jan 2018 10:16:12 +0000 (10:16 +0000)]
releaser: Prepare repository for 0.34-DEV
[ci skip]
hugoreleaser [Thu, 18 Jan 2018 10:13:30 +0000 (10:13 +0000)]
releaser: Add release notes to /docs for release of 0.33
[ci skip]
hugoreleaser [Thu, 18 Jan 2018 10:13:30 +0000 (10:13 +0000)]
releaser: Bump versions for release of 0.33
[ci skip]
Bjørn Erik Pedersen [Thu, 18 Jan 2018 09:56:35 +0000 (10:56 +0100)]
Release 0.33
hugoreleaser [Thu, 18 Jan 2018 09:24:11 +0000 (09:24 +0000)]
releaser: Add release notes draft for 0.33
Rename to *-ready.md to continue. [ci skip]