brevno-suite/hugo
3 years agoValidate private use language tags
Joe Mooring [Sun, 7 Nov 2021 15:06:48 +0000 (07:06 -0800)]
Validate private use language tags

Fixes #9119

3 years agoresources: Add timeout to the HTTP request in Get
Bjørn Erik Pedersen [Thu, 2 Dec 2021 13:13:24 +0000 (14:13 +0100)]
resources: Add timeout to the HTTP request in Get

Workaround for https://github.com/golang/go/issues/49366

3 years agoAdd a remote retry for resources.Get
Bjørn Erik Pedersen [Thu, 2 Dec 2021 12:31:22 +0000 (13:31 +0100)]
Add a remote retry for resources.Get

3 years agoMake resources.Get use a file cache for remote resources
Paul van Brouwershaven [Thu, 2 Dec 2021 11:56:25 +0000 (12:56 +0100)]
Make resources.Get use a file cache for remote resources

Closes #9228

3 years agoRemove empty href element from pagination template
Joe Mooring [Sun, 21 Nov 2021 05:29:04 +0000 (21:29 -0800)]
Remove empty href element from pagination template

Closes #9149

3 years agoCheck for empty deployment targets and matchers
Joe Mooring [Tue, 30 Nov 2021 21:39:47 +0000 (13:39 -0800)]
Check for empty deployment targets and matchers

Fixes #9220

3 years agoresources: Adjust the remote Get cache so it does not get evicted on restarts
Bjørn Erik Pedersen [Tue, 30 Nov 2021 15:54:01 +0000 (16:54 +0100)]
resources: Adjust the remote Get cache so it does not get evicted on restarts

We fill improve this, soon.

3 years agoAdd remote support to resources.Get
Paul van Brouwershaven [Tue, 30 Nov 2021 10:49:51 +0000 (11:49 +0100)]
Add remote support to resources.Get

Closes #5255
Supports #9044

3 years agoAdd deprecation warning to google_news template
Joe Mooring [Sun, 21 Nov 2021 01:49:47 +0000 (17:49 -0800)]
Add deprecation warning to google_news template

Closes #9172

3 years agohelpers: Make UniqueStringsReuse allocation free
Bjørn Erik Pedersen [Tue, 16 Nov 2021 18:20:33 +0000 (19:20 +0100)]
helpers: Make UniqueStringsReuse allocation free

This should be faster for all of our use cases (small string slices), but more important, it makes UniqueStringsReuse allocation free.

```bash
name                                 old time/op    new time/op    delta
UniqueStrings/Safe-16                   776ns ± 0%     305ns ± 0%   -60.68%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice-16            621ns ± 3%     174ns ± 0%   -72.01%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice_sorted-16     319ns ± 4%     313ns ± 0%    -2.01%  (p=0.029 n=4+4)

name                                 old alloc/op   new alloc/op   delta
UniqueStrings/Safe-16                    224B ± 0%      128B ± 0%   -42.86%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice-16            96.0B ± 0%      0.0B       -100.00%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice_sorted-16     24.0B ± 0%     24.0B ± 0%      ~     (all equal)

name                                 old allocs/op  new allocs/op  delta
UniqueStrings/Safe-16                    7.00 ± 0%      1.00 ± 0%   -85.71%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice-16             6.00 ± 0%      0.00       -100.00%  (p=0.029 n=4+4)
UniqueStrings/Reuse_slice_sorted-16      1.00 ± 0%      1.00 ± 0%      ~     (all equal)
```

3 years agoreleaser: Prepare repository for 0.90.0-DEV vanilla/release-0.89.4
hugoreleaser [Wed, 17 Nov 2021 09:05:38 +0000 (09:05 +0000)]
releaser: Prepare repository for 0.90.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.89.4 v0.89.4
hugoreleaser [Wed, 17 Nov 2021 08:24:08 +0000 (08:24 +0000)]
releaser: Add release notes to /docs for release of 0.89.4

[ci skip]

3 years agoreleaser: Bump versions for release of 0.89.4
hugoreleaser [Wed, 17 Nov 2021 08:24:08 +0000 (08:24 +0000)]
releaser: Bump versions for release of 0.89.4

[ci skip]

3 years agoreleaser: Add release notes for 0.89.4
hugoreleaser [Wed, 17 Nov 2021 08:24:08 +0000 (08:24 +0000)]
releaser: Add release notes for 0.89.4
[ci skip]

3 years agoFix content dir resolution when main project is a Hugo Module
Bjørn Erik Pedersen [Tue, 16 Nov 2021 18:54:41 +0000 (19:54 +0100)]
Fix content dir resolution when main project is a Hugo Module

Fixes #9177

3 years agoreleaser: Prepare repository for 0.90.0-DEV vanilla/release-0.89.3
hugoreleaser [Mon, 15 Nov 2021 12:56:41 +0000 (12:56 +0000)]
releaser: Prepare repository for 0.90.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.89.3 v0.89.3
hugoreleaser [Mon, 15 Nov 2021 12:17:45 +0000 (12:17 +0000)]
releaser: Add release notes to /docs for release of 0.89.3

[ci skip]

3 years agoreleaser: Bump versions for release of 0.89.3
hugoreleaser [Mon, 15 Nov 2021 12:17:45 +0000 (12:17 +0000)]
releaser: Bump versions for release of 0.89.3

[ci skip]

3 years agoreleaser: Add release notes for 0.89.3
hugoreleaser [Mon, 15 Nov 2021 12:17:45 +0000 (12:17 +0000)]
releaser: Add release notes for 0.89.3
[ci skip]

3 years agoImprove error when we cannot determine content directory in "hugo new"
Bjørn Erik Pedersen [Mon, 15 Nov 2021 09:25:30 +0000 (10:25 +0100)]
Improve error when we cannot determine content directory in "hugo new"

See #9166

3 years agodeps: Upgrade github.com/yuin/goldmark v1.4.3 => v1.4.4
Joe Mooring [Sun, 14 Nov 2021 18:53:49 +0000 (10:53 -0800)]
deps: Upgrade github.com/yuin/goldmark v1.4.3 => v1.4.4

Fixes #9159

3 years agocommands: Make sure pollInterval is always set
Bjørn Erik Pedersen [Sat, 13 Nov 2021 20:45:51 +0000 (21:45 +0100)]
commands: Make sure pollInterval is always set

Fixes #9165

3 years agocreate: Improve archetype directory discovery and tests
Bjørn Erik Pedersen [Fri, 12 Nov 2021 09:29:13 +0000 (10:29 +0100)]
create: Improve archetype directory discovery and tests

Updates #9146

3 years agocreate: Add a log statement when archetype is a directory
Bjørn Erik Pedersen [Fri, 12 Nov 2021 08:57:20 +0000 (09:57 +0100)]
create: Add a log statement when archetype is a directory

See #9157

3 years agocreate: Always print "Content ... created"
Bjørn Erik Pedersen [Fri, 12 Nov 2021 08:51:13 +0000 (09:51 +0100)]
create: Always print "Content ... created"

This indeliberately changed to INFO level in Hugo 0.89.0.

Fixes #9157

3 years agocommands: Fix missing file locking in server partial render
Bjørn Erik Pedersen [Fri, 12 Nov 2021 08:28:27 +0000 (09:28 +0100)]
commands: Fix missing file locking in server partial render

Fixes #9162

3 years agomodules: Improve error message
Patrick Kollitsch [Wed, 10 Nov 2021 08:32:17 +0000 (15:32 +0700)]
modules: Improve error message

3 years agoreleaser: Prepare repository for 0.90.0-DEV vanilla/release-0.89.2
hugoreleaser [Mon, 8 Nov 2021 15:56:14 +0000 (15:56 +0000)]
releaser: Prepare repository for 0.90.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.89.2 v0.89.2
hugoreleaser [Mon, 8 Nov 2021 15:22:23 +0000 (15:22 +0000)]
releaser: Add release notes to /docs for release of 0.89.2

[ci skip]

3 years agoreleaser: Bump versions for release of 0.89.2
hugoreleaser [Mon, 8 Nov 2021 15:22:23 +0000 (15:22 +0000)]
releaser: Bump versions for release of 0.89.2

[ci skip]

3 years agoreleaser: Add release notes for 0.89.2
hugoreleaser [Mon, 8 Nov 2021 15:22:23 +0000 (15:22 +0000)]
releaser: Add release notes for 0.89.2
[ci skip]

3 years agoFix path resolution in hugo new
Bjørn Erik Pedersen [Mon, 8 Nov 2021 10:50:51 +0000 (11:50 +0100)]
Fix path resolution in hugo new

With theme and project with content directories and command on the form `hugo new posts/test.md`.

Fixes #9129

3 years agodeps: Upgrade github.com/yuin/goldmark v1.4.2 => v1.4.3
Bjørn Erik Pedersen [Mon, 8 Nov 2021 10:09:10 +0000 (11:09 +0100)]
deps: Upgrade github.com/yuin/goldmark v1.4.2 => v1.4.3

Fixes #9137

3 years agoreleaser: Prepare repository for 0.90.0-DEV vanilla/release-0.89.1
hugoreleaser [Fri, 5 Nov 2021 16:24:06 +0000 (16:24 +0000)]
releaser: Prepare repository for 0.90.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.89.1 v0.89.1
hugoreleaser [Fri, 5 Nov 2021 15:44:32 +0000 (15:44 +0000)]
releaser: Add release notes to /docs for release of 0.89.1

[ci skip]

3 years agoreleaser: Bump versions for release of 0.89.1
hugoreleaser [Fri, 5 Nov 2021 15:44:32 +0000 (15:44 +0000)]
releaser: Bump versions for release of 0.89.1

[ci skip]

3 years agoreleaser: Add release notes for 0.89.1
hugoreleaser [Fri, 5 Nov 2021 15:44:32 +0000 (15:44 +0000)]
releaser: Add release notes for 0.89.1
[ci skip]

3 years agoRevert "releaser: Fat MacOS binaries"
Bjørn Erik Pedersen [Fri, 5 Nov 2021 15:31:19 +0000 (16:31 +0100)]
Revert "releaser: Fat MacOS binaries"

This had some side effect that I'm not prepared to fix today ...

This reverts commit 3a977485eb7d5f913da5cc10ef58715ffd273613.

Updates #9131
Updates #9128

3 years agocreate: Make sure the build lock is released before we open editor
Bjørn Erik Pedersen [Thu, 4 Nov 2021 07:57:11 +0000 (08:57 +0100)]
create: Make sure the build lock is released before we open editor

Fixes #9121

3 years agoreadme: Update dependency list
Andreas Deininger [Wed, 3 Nov 2021 16:15:33 +0000 (17:15 +0100)]
readme: Update dependency list

3 years agoreleaser: Prepare repository for 0.90.0-DEV vanilla/release-0.89.0
hugoreleaser [Tue, 2 Nov 2021 10:40:00 +0000 (10:40 +0000)]
releaser: Prepare repository for 0.90.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.89.0 v0.89.0
hugoreleaser [Tue, 2 Nov 2021 10:00:17 +0000 (10:00 +0000)]
releaser: Add release notes to /docs for release of 0.89.0

[ci skip]

3 years agoreleaser: Bump versions for release of 0.89.0
hugoreleaser [Tue, 2 Nov 2021 10:00:17 +0000 (10:00 +0000)]
releaser: Bump versions for release of 0.89.0

[ci skip]

3 years agoreleaser: Add release notes for 0.89.0
hugoreleaser [Tue, 2 Nov 2021 08:14:29 +0000 (08:14 +0000)]
releaser: Add release notes for 0.89.0

3 years agodocs: Regen CLI docs
Bjørn Erik Pedersen [Tue, 2 Nov 2021 08:01:26 +0000 (09:01 +0100)]
docs: Regen CLI docs

3 years agosource: Make ContentBaseName() return the directory for branch bundles
Bjørn Erik Pedersen [Mon, 1 Nov 2021 19:30:34 +0000 (20:30 +0100)]
source: Make ContentBaseName() return the directory for branch bundles

Fixes #9112

3 years agoFix description of lang.FormatNumberCustom
Joe Mooring [Mon, 1 Nov 2021 17:43:41 +0000 (10:43 -0700)]
Fix description of lang.FormatNumberCustom

It currently refers to itself as a simple alternative, when it should
refer to lang.FormatNumber.

3 years agoUpdate Twitter shortcode oEmbed endpoint
Joe Mooring [Sun, 31 Oct 2021 10:56:36 +0000 (03:56 -0700)]
Update Twitter shortcode oEmbed endpoint

The existing endpoint will be retired and removed on November 23, 2021.
References:

- https://twittercommunity.com/t/consolidating-the-oembed-functionality/154690
- https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api#Embedded

This is a backward compatible change.

The existing endpoint requires a single parameter: the id of the tweet.

The new endpoint requires two parameters: the id of the tweet, and the
user with whom it is associated. For the moment, if you supply the wrong
user, the request will be redirected (with a small delay) to the correct
user/id pair. This behavior is undocumented, but we will take advantage
of it as Hugo site authors transition to the new syntax.

{{< tweet 1453110110599868418 >}} --> works, throws warning, deprecate at some point

{{< tweet user="SanDiegoZoo" id="1453110110599868418" >}} --> new syntax

Fixes #8130

3 years agocommon/htime: Fix time.Format with Go layouts
Bjørn Erik Pedersen [Mon, 1 Nov 2021 14:20:57 +0000 (15:20 +0100)]
common/htime: Fix time.Format with Go layouts

Fixes #9107

3 years agobuild(deps): bump github.com/evanw/esbuild from 0.13.10 to 0.13.12
dependabot[bot] [Mon, 1 Nov 2021 08:14:48 +0000 (08:14 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.13.10 to 0.13.12

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.13.10 to 0.13.12.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.13.10...v0.13.12)

---
updated-dependencies:
- dependency-name: github.com/evanw/esbuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github.com/yuin/goldmark from 1.4.1 to 1.4.2
dependabot[bot] [Sat, 30 Oct 2021 09:25:08 +0000 (09:25 +0000)]
build(deps): bump github.com/yuin/goldmark from 1.4.1 to 1.4.2

Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoMerge commit 'aa5ac36a3eb68b86c803caec703869efefc8447e'
Bjørn Erik Pedersen [Sun, 31 Oct 2021 12:53:55 +0000 (13:53 +0100)]
Merge commit 'aa5ac36a3eb68b86c803caec703869efefc8447e'

3 years agoSquashed 'docs/' changes from 327003421..39a7fac34
Bjørn Erik Pedersen [Sun, 31 Oct 2021 12:51:51 +0000 (13:51 +0100)]
Squashed 'docs/' changes from 327003421..39a7fac34

39a7fac34 Add .hugo_build.lock to .gitignore
920c716a4 fix a typo: to -> two (#1545)
6f0ba9593 Remove godocref from front matter (#1543)
8ec3d5948 remove link to wercker (#1544)
b56008719 Delete deployment-with-wercker.md (#1542)
e33d29b02 Fix broken links (#1538)
29e9d4c21 Sort commenting systems (#1541)
0b7ea60a7 Delete the news page "HTTP/2 Server Push in Hugo"
6e1515857 Fix quick-start.md (#1525)
62168ab35 Update comments.md (#1535)
d92191512 Small typo (#1539)
129c8834a Correct the PostCSS noMap default value (#1534)
6a5b29fcc Add example to index function (#1536)
e3dd8c507 Update output-formats.md
0c9321ca0 Remove reference to using LiveReload in production environment
4072d6776 Mod testing
09fabf7d6 Fix typo (#1524)
2fce813c8 Fix grammatical error in quick-start.md (#1523)
45230ab4a Hugo Mod testing
2dd4cd9e7 Update index.md
2c3ed62fd netlify: Bump to 0.88.1
648e2a007 Merge branch 'tempv0.88.1'
f216eade1 releaser: Add release notes to /docs for release of 0.88.1
8a7b64d4b Fix typographical errors in 0.88.0 release notes
a4bf86300 Release 0.88
738bb8f38 releaser: Add release notes to /docs for release of 0.88.0
8fcf2c55d highlight: Remove some pygments references
f2b173de2 HTTPS link
c88881c8e Adding link to nginx documentation
6b0a74fe0 Fix typos in docs (#1516)
498b8f0f1 Fix typos in time.Format (#1515)
28723fad6 Fix taxonomy and term examples (#1514)
3ffd00e12 Update front-matter.md
7cc1da82e Fix grammar in 0.86.1 release notes (#1510)
0009c51c3 Update docs helper
7e2f430f4 Update index.md
7857eae7e releaser: Add release notes to /docs for release of 0.87.0
1f08b684b releaser: Add release notes to /docs for release of 0.87.0
36a9e701c docs: Adjust config docs
0f588438e docs: Regen CLI docs
1b4682cd8 docs: Regen docs helper
bc8bbaae9 Merge commit 'bd77f6e1c99e04a476f0b1bb4e44569134e02399' into release-0.87.0
6f2480643 docs: Adjust time zone docs

git-subtree-dir: docs
git-subtree-split: 39a7fac343c289906db644c96079fdcc0298582f

3 years agoreleaser: Fat MacOS binaries
Bjørn Erik Pedersen [Sat, 30 Oct 2021 08:07:27 +0000 (10:07 +0200)]
releaser: Fat MacOS binaries

Fixes #9035

3 years agoreleaser: Only build amd64 binary for freebsd, netbsd, openbsd, dragonfly
Bjørn Erik Pedersen [Sat, 30 Oct 2021 09:25:04 +0000 (11:25 +0200)]
releaser: Only build amd64 binary for freebsd, netbsd, openbsd, dragonfly

Fixes #9102

3 years agotpl/time: Use configured location when date passed to Format is string
Bjørn Erik Pedersen [Sat, 30 Oct 2021 14:06:00 +0000 (16:06 +0200)]
tpl/time: Use configured location when date passed to Format is string

Updates #9084

3 years agobuild(deps): bump github.com/aws/aws-sdk-go from 1.40.8 to 1.41.14
dependabot[bot] [Sat, 30 Oct 2021 07:44:20 +0000 (07:44 +0000)]
build(deps): bump github.com/aws/aws-sdk-go from 1.40.8 to 1.41.14

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.40.8 to 1.41.14.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.40.8...v1.41.14)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github.com/getkin/kin-openapi from 0.79.0 to 0.80.0
dependabot[bot] [Sat, 30 Oct 2021 07:43:20 +0000 (07:43 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.79.0 to 0.80.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.79.0 to 0.80.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.79.0...v0.80.0)

---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github.com/evanw/esbuild from 0.13.8 to 0.13.10
dependabot[bot] [Thu, 28 Oct 2021 08:18:39 +0000 (08:18 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.13.8 to 0.13.10

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.13.8 to 0.13.10.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.13.8...v0.13.10)

---
updated-dependencies:
- dependency-name: github.com/evanw/esbuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoresources: Rename excepted filenames for image golden testdata
Anthony Fok [Thu, 28 Oct 2021 22:14:14 +0000 (16:14 -0600)]
resources: Rename excepted filenames for image golden testdata

As documented in commit 30eea3915b67f72611a3b2f4547146d4c6a96864,
some filenames have changed due to cache busting of PNG and Webp images.

This resolves recent TestImageOperationsGolden failure on arm64, ppc64le
and s390x.

See #6387 and #8729

3 years agobuild(deps): bump github.com/frankban/quicktest from 1.13.1 to 1.14.0
dependabot[bot] [Wed, 20 Oct 2021 16:34:52 +0000 (16:34 +0000)]
build(deps): bump github.com/frankban/quicktest from 1.13.1 to 1.14.0

Bumps [github.com/frankban/quicktest](https://github.com/frankban/quicktest) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/frankban/quicktest/releases)
- [Commits](https://github.com/frankban/quicktest/compare/v1.13.1...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/frankban/quicktest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoFix typo in error message
Joe Mooring [Mon, 25 Oct 2021 20:35:35 +0000 (13:35 -0700)]
Fix typo in error message

3 years agocreate: Validate the target path in hugo new
Bjørn Erik Pedersen [Mon, 25 Oct 2021 10:28:12 +0000 (12:28 +0200)]
create: Validate the target path in hugo new

Fixes #9072

3 years agoFix panic when specifying multiple excludeFiles directives
Bjørn Erik Pedersen [Mon, 25 Oct 2021 10:18:00 +0000 (12:18 +0200)]
Fix panic when specifying multiple excludeFiles directives

Fixes #9076

3 years agohtime: Set zone of datetime from from `go-toml`
satotake [Mon, 25 Oct 2021 17:49:44 +0000 (02:49 +0900)]
htime: Set zone of datetime from from `go-toml`

`go-toml/v2`'s unmarshaler does not specify zone name even if value has
offset explicitly.
To make time-formatting behaviour consistent, convert them into string
in hugo.

Close #8895

3 years agoAdded nodesource apt repository to snap package
Sergio Garcia [Mon, 11 Oct 2021 21:39:02 +0000 (18:39 -0300)]
Added nodesource apt repository to snap package

3 years agoconfig: Set HUGO_ENABLEGITINFO=false override in Set_in_string
Anthony Fok [Fri, 22 Oct 2021 11:12:09 +0000 (05:12 -0600)]
config: Set HUGO_ENABLEGITINFO=false override in Set_in_string

This allows TestLoadConfigWithOsEnvOverrides/Set_in_string to PASS
even if there is no .git directory, e.g. during Debian package build.

3 years agohugofs: Add includeFiles and excludeFiles to mount configuration
Bjørn Erik Pedersen [Sat, 16 Oct 2021 14:24:49 +0000 (16:24 +0200)]
hugofs: Add includeFiles and excludeFiles to mount configuration

Fixes #9042

3 years agobuild(deps): bump github.com/mitchellh/mapstructure from 1.4.1 to 1.4.2
dependabot[bot] [Thu, 14 Oct 2021 08:38:44 +0000 (08:38 +0000)]
build(deps): bump github.com/mitchellh/mapstructure from 1.4.1 to 1.4.2

Bumps [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/mitchellh/mapstructure/releases)
- [Changelog](https://github.com/mitchellh/mapstructure/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitchellh/mapstructure/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: github.com/mitchellh/mapstructure
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoresources: Always preserve the original transform error
Bjørn Erik Pedersen [Tue, 19 Oct 2021 18:38:38 +0000 (20:38 +0200)]
resources: Always preserve the original transform error

3 years agoreadme: Add hyperlink to the banner
itsAftabAlam [Tue, 19 Oct 2021 13:59:12 +0000 (19:29 +0530)]
readme: Add hyperlink to the banner

3 years agobuild(deps): bump github.com/getkin/kin-openapi from 0.78.0 to 0.79.0
dependabot[bot] [Sun, 17 Oct 2021 15:22:39 +0000 (15:22 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.78.0 to 0.79.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.78.0 to 0.79.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.78.0...v0.79.0)

---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agodeps: github.com/evanw/esbuild v0.13.5 => v0.13.8
Bjørn Erik Pedersen [Tue, 19 Oct 2021 06:14:36 +0000 (08:14 +0200)]
deps: github.com/evanw/esbuild v0.13.5 => v0.13.8

3 years agocreate: Return error on no content dirs
Bjørn Erik Pedersen [Tue, 19 Oct 2021 06:08:21 +0000 (08:08 +0200)]
create: Return error on no content dirs

Closes #9056

3 years agoFix file permissions in new archetype implementation
Bjørn Erik Pedersen [Mon, 18 Oct 2021 17:08:19 +0000 (19:08 +0200)]
Fix file permissions in new archetype implementation

Closes #9057

3 years agoFix the "page picker" logic in --navigateToChanged
Bjørn Erik Pedersen [Sun, 17 Oct 2021 14:11:00 +0000 (16:11 +0200)]
Fix the "page picker" logic in --navigateToChanged

Fixes #9051

3 years agoAdd a cross process build lock and use it in the archetype content builder
Bjørn Erik Pedersen [Sun, 17 Oct 2021 09:54:55 +0000 (11:54 +0200)]
Add a cross process build lock and use it in the archetype content builder

Fixes #9048

3 years agoreadme: Fix a typo on OpenBSD
nabbisen [Sun, 17 Oct 2021 19:23:01 +0000 (04:23 +0900)]
readme: Fix a typo on OpenBSD

3 years agodeps: github.com/alecthomas/chroma v0.9.2 => v0.9.4
Bjørn Erik Pedersen [Sun, 17 Oct 2021 14:39:22 +0000 (16:39 +0200)]
deps: github.com/alecthomas/chroma v0.9.2 => v0.9.4

Fixes #8532

3 years agoReimplement archetypes
Bjørn Erik Pedersen [Wed, 13 Oct 2021 06:12:06 +0000 (08:12 +0200)]
Reimplement archetypes

The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template.

This new implementation is using the exact same code path for evaluating the pages as in a regular build.

This also makes it more robust and easier to reason about in a multilingual setup.

Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language:

```bash
hugo new content/en/posts/my-first-post.md
```

Fixes #9032
Fixes #7589
Fixes #9043
Fixes #9046
Fixes #9047

3 years agobuild(deps): bump github.com/tdewolff/minify/v2 from 2.9.21 to 2.9.22
dependabot[bot] [Sun, 10 Oct 2021 18:47:09 +0000 (18:47 +0000)]
build(deps): bump github.com/tdewolff/minify/v2 from 2.9.21 to 2.9.22

Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.9.21 to 2.9.22.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.9.21...v2.9.22)

---
updated-dependencies:
- dependency-name: github.com/tdewolff/minify/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agodeps: Update github.com/evanw/esbuild v0.13.5
Bjørn Erik Pedersen [Wed, 13 Oct 2021 06:13:02 +0000 (08:13 +0200)]
deps: Update github.com/evanw/esbuild v0.13.5

3 years agoreleaser: Fix regexp
Iskander (Alex) Sharipov [Tue, 12 Oct 2021 09:32:09 +0000 (12:32 +0300)]
releaser: Fix regexp

Original regexp used a char class which caused the regexp to only
check 1 symbol instead of a substring like "See" and "Closes".
So it would match `e #x` instead of `See #x` and many other
weird combinations.

Tests were passing as they never checked against an input that
would confuse that regexp.

Found with go-critic static analyzer, `badRegexp` checker.

3 years agobuild(deps): bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14
dependabot[bot] [Sun, 10 Oct 2021 16:59:28 +0000 (16:59 +0000)]
build(deps): bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14

Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.13 to 0.0.14.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.13...v0.0.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-isatty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github.com/getkin/kin-openapi from 0.75.0 to 0.78.0
dependabot[bot] [Sun, 10 Oct 2021 16:58:38 +0000 (16:58 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.75.0 to 0.78.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.75.0 to 0.78.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.75.0...v0.78.0)

---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoreleaser: Update to Go go1.17.2
Bjørn Erik Pedersen [Sun, 10 Oct 2021 14:51:06 +0000 (16:51 +0200)]
releaser: Update to Go go1.17.2

* This now uses the `golang:1.17.2-buster` Docker image which runs GLIBC 2.28-10.
* Also added a build hook to warn us if this happens again in the future.

Fixes #8955

3 years agoFix value of useResourceCacheWhen in TestResourceChainPostCSS
Joe Mooring [Sat, 9 Oct 2021 16:16:52 +0000 (09:16 -0700)]
Fix value of useResourceCacheWhen in TestResourceChainPostCSS

3 years agoAllow multiple plugins in the PostCSS options map
Joe Mooring [Sat, 9 Oct 2021 05:34:08 +0000 (22:34 -0700)]
Allow multiple plugins in the PostCSS options map

Usage:
{{ $options := dict "use" "autoprefixer postcss-color-alpha" }}
{{ $style := resources.Get "main.css" | resources.PostCSS $options }}

Fixes #9015

3 years agodocs: Create path.Clean documentation
Joe Mooring [Sat, 9 Oct 2021 18:36:57 +0000 (11:36 -0700)]
docs: Create path.Clean documentation

Related to #9005

3 years agoSkip a test assertion on CI
Bjørn Erik Pedersen [Sat, 9 Oct 2021 15:17:38 +0000 (17:17 +0200)]
Skip a test assertion on CI

Need to investigate later, but got to get the tests green.

3 years agotpl/path: Add path.Clean
Brad [Tue, 5 Oct 2021 14:15:10 +0000 (10:15 -0400)]
tpl/path: Add path.Clean

 Fixes #8885

3 years agoreadme: Remove tracking image
Shalabh Kamboj [Tue, 5 Oct 2021 13:09:11 +0000 (18:39 +0530)]
readme: Remove tracking image

The server for the tracking image for analytics is currently down,
therefore I found it convenient to remove the link in order to maintain our readme

3 years agoRevert "Remove credit from release notes"
digitalcraftsman [Thu, 23 Sep 2021 12:02:00 +0000 (14:02 +0200)]
Revert "Remove credit from release notes"

See b2eaf4c8c2e31aa1c1bc4a2c0061f661e01d2de1

3 years agoPass minification errors to the user
Paul Gottschling [Wed, 22 Sep 2021 18:54:40 +0000 (14:54 -0400)]
Pass minification errors to the user

Previously, *minifyTransformation.Transform suppressed the
error returned by t.m.Minify. This meant that when minification
returned an error, the error would not reach the user. Instead,
minification would silently fail. For example, if a JavaScript
file included a call to the Date constructor with:

new Date(2020, 04, 02)

The package that the minification library uses to parse JS files,
github.com/tdewolff/parse would return an error, since "04" would
be parsed as a legacy octal. However, the JS file would remain
un-minified with no error.

Fixing this is not as simple as replacing "_" with an "err" in
*minifyTransformation.Transform, however (though this is
necessary). If we only returned this error from Transform,
then hugolib.TestResourceMinifyDisabled would fail. Instead of
being a no-op, as TestResourceMinifyDisabled expects, using the
"minify" template function with a "disableXML=true" config
setting instead returns the error, "minifier does not exist for
mimetype."

The "minifier does not exist" error is returned because of the
way minifiers.New works. If the user's config disables
minification for a particular MIME type, minifiers.New does
not add it to the resulting Client's *minify.M. However, this
also means that when the "minify" template function is executed,
 a *resourceAdapter's transformations still add a minification.
When it comes time to call the minify.Minifier for a specific
MIME type via *M.MinifyMimetype, the github.com/tdewolff/minify
library throws the "does not exist" error for the missing MIME
type.

The solution was to change minifiers.New so, instead of skipping
a minifier for each disabled MIME type, it adds  a NoOpMinifier,
which simply copies the source to the destination without
minification. This means that when the "minify" template
function is used for a particular resource, and that resource's
MIME type has minification disabled, minification is genuinely
skipped, and does not result in an error.

In order to add this, I've fixed a possibly unwanted interaction
between minifiers.TestConfigureMinify and
hugolib.TestResourceMinifyDisabled. The latter disables
minification and expects minification to be a no-op. The former
disables minification and expects it to result in an error. The
only reason hugolib.TestResourceMinifyDisabled passes in the
original code is that the "does not exist" error is suppressed.
However, we shouldn't suppress minification errors, since they
can leave users perplexed. I've changed the test assertion in
minifiers.TestConfigureMinify to expect no errors and a no-op
if minification is disabled for a particular MIME type.

Fixes #8954

3 years agoClarify "precision" in currency format functions
Paul Gottschling [Thu, 2 Sep 2021 00:26:42 +0000 (20:26 -0400)]
Clarify "precision" in currency format functions

The documentation of the FormatAccounting and FormatCurrency
functions could be clearer in terms of how the precision param
works. This commit makes it more explicit that adding a precision
of < 2 will not format the return values to include fewer decimals.

Resolves #8858

3 years agobuild(deps): bump github.com/evanw/esbuild from 0.12.24 to 0.12.29
dependabot[bot] [Wed, 22 Sep 2021 08:11:53 +0000 (08:11 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.12.24 to 0.12.29

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.12.24 to 0.12.29.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.12.24...v0.12.29)

---
updated-dependencies:
- dependency-name: github.com/evanw/esbuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoresources: Use default math/rand.Source for concurrency safety
Emmanuel T Odeke [Sun, 19 Sep 2021 10:18:30 +0000 (04:18 -0600)]
resources: Use default math/rand.Source for concurrency safety

The source from NewSource is documented not to be safe for
concurrency, and instead use the eefault source which is documented
as safe.

Fixes #8981

3 years agocommands: Make the error handling for the mod commands more lenient
Bjørn Erik Pedersen [Fri, 17 Sep 2021 15:16:34 +0000 (17:16 +0200)]
commands: Make the error handling for the mod commands more lenient

So it at least is possible to do a `hugo mod clean --all` if the cache is in a funky state.

3 years agomodules: Add some help text to the 'unknown revision' error
Bjørn Erik Pedersen [Fri, 17 Sep 2021 07:34:35 +0000 (09:34 +0200)]
modules: Add some help text to the 'unknown revision' error

I had a head scratching moment with this myself, so it's safe to say that others will.

See #6825

3 years agodeps: Update github.com/yuin/goldmark v1.4.0 => v1.4.1
Joe Mooring [Sun, 12 Sep 2021 17:10:47 +0000 (10:10 -0700)]
deps: Update github.com/yuin/goldmark v1.4.0 => v1.4.1

Fixes #8855