brevno-suite/hugo
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

3 years agoreleaser: Prepare repository for 0.89.0-DEV
hugoreleaser [Sat, 4 Sep 2021 10:33:09 +0000 (10:33 +0000)]
releaser: Prepare repository for 0.89.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.88.1 v0.88.1
hugoreleaser [Sat, 4 Sep 2021 09:39:19 +0000 (09:39 +0000)]
releaser: Add release notes to /docs for release of 0.88.1

[ci skip]

3 years agoreleaser: Bump versions for release of 0.88.1
hugoreleaser [Sat, 4 Sep 2021 09:39:19 +0000 (09:39 +0000)]
releaser: Bump versions for release of 0.88.1

[ci skip]

3 years agoreleaser: Add release notes for 0.88.1
hugoreleaser [Sat, 4 Sep 2021 09:39:19 +0000 (09:39 +0000)]
releaser: Add release notes for 0.88.1
[ci skip]

3 years agoBump down again to Go 1.16.7 for the release builds
Bjørn Erik Pedersen [Sat, 4 Sep 2021 09:22:51 +0000 (11:22 +0200)]
Bump down again to Go 1.16.7 for the release builds

Note that this commit has nothing to do with "Hugo not working with Go 1.17", but this is the simplest fix of some build related issues in Hugo 0.88.0.

Updates #8952
Updates #8955

3 years agoreleaser: Prepare repository for 0.89.0-DEV
hugoreleaser [Thu, 2 Sep 2021 09:57:36 +0000 (09:57 +0000)]
releaser: Prepare repository for 0.89.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.88.0 v0.88.0
hugoreleaser [Thu, 2 Sep 2021 09:27:27 +0000 (09:27 +0000)]
releaser: Add release notes to /docs for release of 0.88.0

[ci skip]

3 years agoreleaser: Bump versions for release of 0.88.0
hugoreleaser [Thu, 2 Sep 2021 09:27:27 +0000 (09:27 +0000)]
releaser: Bump versions for release of 0.88.0

[ci skip]

3 years agoRelease 0.88.0
Bjørn Erik Pedersen [Thu, 2 Sep 2021 09:11:08 +0000 (11:11 +0200)]
Release 0.88.0

3 years agoUpdate 0.88.0-relnotes.md
Bjørn Erik Pedersen [Thu, 2 Sep 2021 09:10:40 +0000 (11:10 +0200)]
Update 0.88.0-relnotes.md

[ci skip]

3 years agoreleaser: Add release notes for 0.88.0
hugoreleaser [Thu, 2 Sep 2021 08:09:25 +0000 (08:09 +0000)]
releaser: Add release notes for 0.88.0

Rename to *-ready.md to continue.
[ci skip]

3 years agoRun go mod tidy
Bjørn Erik Pedersen [Wed, 1 Sep 2021 08:48:13 +0000 (10:48 +0200)]
Run go mod tidy

3 years agojs: Fix import order for ./foo when both ./foo.js and ./foo/index.js exists
Bjørn Erik Pedersen [Wed, 1 Sep 2021 07:07:29 +0000 (09:07 +0200)]
js: Fix import order for ./foo when both ./foo.js and ./foo/index.js exists

This is in line with how both Node and ESBuild's native import resolver does it.

The ambiguous situations above were discovered trying to build AlpineJS v3.

Note that the above was never an issue if you used `./foo.js` and similar to import the component.

Fixes #8945

3 years agocommands: Don't fail on template errors on go mod graph etc.
Bjørn Erik Pedersen [Tue, 31 Aug 2021 15:02:51 +0000 (17:02 +0200)]
commands: Don't fail on template errors on go mod graph etc.

Fixes #8942

3 years agobuild(deps): bump github.com/getkin/kin-openapi from 0.74.0 to 0.75.0
dependabot[bot] [Mon, 30 Aug 2021 08:19:16 +0000 (08:19 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.74.0 to 0.75.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.74.0 to 0.75.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.74.0...v0.75.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/frankban/quicktest from 1.13.0 to 1.13.1
dependabot[bot] [Tue, 24 Aug 2021 08:14:50 +0000 (08:14 +0000)]
build(deps): bump github.com/frankban/quicktest from 1.13.0 to 1.13.1

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

---
updated-dependencies:
- dependency-name: github.com/frankban/quicktest
  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/evanw/esbuild from 0.12.22 to 0.12.24
dependabot[bot] [Mon, 30 Aug 2021 08:19:56 +0000 (08:19 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.12.22 to 0.12.24

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.12.22 to 0.12.24.
- [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.22...v0.12.24)

---
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 agoAvoid failing with "module not found" for hugo mod init and similar
Bjørn Erik Pedersen [Tue, 31 Aug 2021 10:08:11 +0000 (12:08 +0200)]
Avoid failing with "module not found" for hugo mod init and similar

Fixes #8940

3 years agoUpdate to Go 1.17
Bjørn Erik Pedersen [Thu, 26 Aug 2021 15:24:52 +0000 (17:24 +0200)]
Update to Go 1.17

Go 1.17 now lazy-loads dependencies when `go.mod` is version `go17`. This does not work for us for new projects started with `hugo mod init`.

Before this commit, starting a project with Go 1.17 with `hugo mod init` and then start adding dependencies with transitive dependenies to `config.toml` would treat the transitive dependencies as new, and you would potentially get a too recent version of those.

Note that this does not effect existing projects, where all dependencies are already recorded in `go.mod`.

Fixes #8930

3 years agoRemove Pygments from snapcraft.yml
Anthony Fok [Wed, 25 Aug 2021 16:43:32 +0000 (10:43 -0600)]
Remove Pygments from snapcraft.yml

Pygments support was removed in Hugo v0.60.0

3 years agoRevert "build(deps): bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0"
Bjørn Erik Pedersen [Mon, 23 Aug 2021 16:20:29 +0000 (18:20 +0200)]
Revert "build(deps): bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0"

This reverts commit f70165242b98e3ee182fbac08bf2893a7f09e961.

Closes #8920

3 years agohighlight: Add tabindex when code is not highlighted
Helder Pereira [Sun, 22 Aug 2021 14:03:20 +0000 (15:03 +0100)]
highlight: Add tabindex when code is not highlighted

3 years agobuild(deps): bump github.com/evanw/esbuild from 0.12.17 to 0.12.22
dependabot[bot] [Sun, 22 Aug 2021 11:01:08 +0000 (11:01 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.12.17 to 0.12.22

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.12.17 to 0.12.22.
- [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.17...v0.12.22)

---
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 agoFix it so disableKinds etc. does not get merged in from theme
Bjørn Erik Pedersen [Sun, 22 Aug 2021 09:57:37 +0000 (11:57 +0200)]
Fix it so disableKinds etc. does not get merged in from theme

Unless the merge strategy is set up to do so.

For `disableKinds` the current workaround is to make sure the project config has an entry, even if is empty:

```
disableKinds = []
```

Note that this issue only touches root, non-map config-values that either is not set in project config or in Hugo's defaults.

Fixes #8866

3 years agobuild(deps): bump golang.org/x/text from 0.3.6 to 0.3.7
dependabot[bot] [Wed, 11 Aug 2021 08:11:09 +0000 (08:11 +0000)]
build(deps): bump golang.org/x/text from 0.3.6 to 0.3.7

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  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/fsnotify/fsnotify from 1.4.9 to 1.5.0
dependabot[bot] [Thu, 19 Aug 2021 08:16:27 +0000 (08:16 +0000)]
build(deps): bump github.com/fsnotify/fsnotify from 1.4.9 to 1.5.0

Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.4.9 to 1.5.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.4.9...v1.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoPrevent minifier from removing quoutes around post-processed attributes
Bjørn Erik Pedersen [Thu, 19 Aug 2021 09:30:50 +0000 (11:30 +0200)]
Prevent minifier from removing quoutes around post-processed attributes

Fixes #8884

3 years agoRevert "commands: Avoid too many watch file handles causing the server to fail to...
Bjørn Erik Pedersen [Sat, 21 Aug 2021 14:32:20 +0000 (16:32 +0200)]
Revert "commands: Avoid too many watch file handles causing the server to fail to start"

This reverts commit 3f38c785b7208440e2a9dd9a80cb39d4ae23e676.

3 years agohighlight: Remove some pygments references
Helder Pereira [Sat, 21 Aug 2021 10:46:18 +0000 (11:46 +0100)]
highlight: Remove some pygments references

3 years agocommands: Avoid too many watch file handles causing the server to fail to start
Shiming Zhang [Thu, 19 Aug 2021 09:04:09 +0000 (17:04 +0800)]
commands: Avoid too many watch file handles causing the server to fail to start

Fixes #8904

3 years agobuild(deps): bump github.com/getkin/kin-openapi from 0.68.0 to 0.74.0
dependabot[bot] [Tue, 17 Aug 2021 08:21:42 +0000 (08:21 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.68.0 to 0.74.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.68.0 to 0.74.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.68.0...v0.74.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: Update github.com/spf13/cast v1.4.0 => v1.4.1
Bjørn Erik Pedersen [Mon, 16 Aug 2021 07:16:41 +0000 (09:16 +0200)]
deps: Update github.com/spf13/cast v1.4.0 => v1.4.1

Closes #8891

3 years agoImport time/tzdata on Windows
Bjørn Erik Pedersen [Sat, 14 Aug 2021 10:09:41 +0000 (12:09 +0200)]
Import time/tzdata on Windows

Updates #8892

3 years agoreleaser: Bump to Go 1.16.7
Bjørn Erik Pedersen [Tue, 10 Aug 2021 12:00:49 +0000 (14:00 +0200)]
releaser: Bump to Go 1.16.7

3 years agoRevert "tpl/time: Handle nil values in time.AsTime"
Bjørn Erik Pedersen [Tue, 10 Aug 2021 11:21:49 +0000 (13:21 +0200)]
Revert "tpl/time: Handle nil values in time.AsTime"

This reverts commit 3e11072892ca31bb76980ee38890a4bd92d83dfd.

3 years agotpl/time: Handle nil values in time.AsTime
Bjørn Erik Pedersen [Mon, 9 Aug 2021 16:44:35 +0000 (18:44 +0200)]
tpl/time: Handle nil values in time.AsTime

Closes #8865

3 years agoparser: Indent TOML tables
Bjørn Erik Pedersen [Wed, 4 Aug 2021 09:33:30 +0000 (11:33 +0200)]
parser: Indent TOML tables

Fixes #8850

3 years agoFix `lang.FormatPercent` description
Salim B [Tue, 3 Aug 2021 14:22:28 +0000 (14:22 +0000)]
Fix `lang.FormatPercent` description

Successor PR for https://github.com/gohugoio/hugoDocs/pull/1504

3 years agoreleaser: Prepare repository for 0.88.0-DEV
hugoreleaser [Tue, 3 Aug 2021 12:11:56 +0000 (12:11 +0000)]
releaser: Prepare repository for 0.88.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.87.0 v0.87.0
hugoreleaser [Tue, 3 Aug 2021 10:57:26 +0000 (10:57 +0000)]
releaser: Add release notes to /docs for release of 0.87.0

[ci skip]

3 years agoreleaser: Bump versions for release of 0.87.0
hugoreleaser [Tue, 3 Aug 2021 10:57:26 +0000 (10:57 +0000)]
releaser: Bump versions for release of 0.87.0

[ci skip]

3 years agoRelease 0.87
Bjørn Erik Pedersen [Tue, 3 Aug 2021 10:42:22 +0000 (12:42 +0200)]
Release 0.87

3 years agoMerge branch 'b087' into release-0.87.0
Bjørn Erik Pedersen [Tue, 3 Aug 2021 10:38:58 +0000 (12:38 +0200)]
Merge branch 'b087' into release-0.87.0

3 years agoUpdate 0.87.0-relnotes.md
Bjørn Erik Pedersen [Tue, 3 Aug 2021 10:31:41 +0000 (12:31 +0200)]
Update 0.87.0-relnotes.md

[ci skip]

3 years agoUpdate 0.87.0-relnotes.md
Bjørn Erik Pedersen [Tue, 3 Aug 2021 10:30:42 +0000 (12:30 +0200)]
Update 0.87.0-relnotes.md

[ci skip]

3 years agodocs: Adjust config docs
Bjørn Erik Pedersen [Tue, 3 Aug 2021 10:17:50 +0000 (12:17 +0200)]
docs: Adjust config docs

3 years agodocs: Regen CLI docs
Bjørn Erik Pedersen [Tue, 3 Aug 2021 09:55:02 +0000 (11:55 +0200)]
docs: Regen CLI docs

3 years agodocs: Regen docs helper
Bjørn Erik Pedersen [Tue, 3 Aug 2021 09:53:34 +0000 (11:53 +0200)]
docs: Regen docs helper

3 years agoMerge commit 'bd77f6e1c99e04a476f0b1bb4e44569134e02399' into release-0.87.0
Bjørn Erik Pedersen [Tue, 3 Aug 2021 09:52:57 +0000 (11:52 +0200)]
Merge commit 'bd77f6e1c99e04a476f0b1bb4e44569134e02399' into release-0.87.0

3 years agoSquashed 'docs/' changes from 60a58d123..327003421
Bjørn Erik Pedersen [Tue, 3 Aug 2021 09:51:36 +0000 (11:51 +0200)]
Squashed 'docs/' changes from 60a58d123..327003421

327003421 Update index.md
cafdccc13 Hugo 0.86.1
467a89a02 Merge branch 'v0861'
a22c37bc9 Merge branch 'release-0.86.1'
276da91a8 releaser: Add release notes to /docs for release of 0.86.1
198cdf8f0 tpl/lang: Add new localized versions of lang.FormatNumber etc.
93f986ecc Add timezone support for front matter dates without one
b30b876bb Localize time.Format
950fdab90 Fix AddDate documentation
78d7b52b6 Document config.cascade
fd1e1e4b7 Fix grammar and spelling (#1497)
05bf3aa32 Fix grammar / typos in news
32060a3b4 One more try
f6e24ddfa PNG to JPG for the rel notes image
9ec5bdfad Update index.md
5f5d7f69d Release Hugo 0.86.0
2dd60bb71 releaser: Add release notes to /docs for release of 0.86.0
6445fb36c Merge commit '53a352795a69a9d4a373f50ec62138595948c6ea'
cb57ca73a Simplify "active menu" logic for section menus

git-subtree-dir: docs
git-subtree-split: 327003421d8c07f9764aaaf644626805287fd30c

3 years agodocs: Adjust time zone docs
Bjørn Erik Pedersen [Tue, 3 Aug 2021 09:49:28 +0000 (11:49 +0200)]
docs: Adjust time zone docs

3 years agoreleaser: Add release notes for 0.87.0
hugoreleaser [Tue, 3 Aug 2021 08:45:16 +0000 (08:45 +0000)]
releaser: Add release notes for 0.87.0

Rename to *-ready.md to continue.
[ci skip]

3 years agoMake sure module config loading errors have file positioning info
Bjørn Erik Pedersen [Tue, 3 Aug 2021 07:57:14 +0000 (09:57 +0200)]
Make sure module config loading errors have file positioning info

Fixes #8845

3 years agotpl/time: Adjust tests to handle matching local time zones
Bjørn Erik Pedersen [Tue, 3 Aug 2021 04:58:25 +0000 (06:58 +0200)]
tpl/time: Adjust tests to handle matching local time zones

Closes #8843

3 years agomod: Remove superflous replace statement
Bjørn Erik Pedersen [Mon, 2 Aug 2021 18:33:13 +0000 (20:33 +0200)]
mod: Remove superflous replace statement

3 years agoReduce binary size vs locale, update to CLDR v36.1
Bjørn Erik Pedersen [Mon, 2 Aug 2021 14:24:04 +0000 (16:24 +0200)]
Reduce binary size vs locale, update to CLDR v36.1

Test building with `go build -ldflags="-s -w"`

Hugo 0.86.2: 46MB
Before this commit: 77MB
After this commit: 54MB

Fixes #8839
Fixes #8841

3 years agodeps: Update github.com/tdewolff/minify/v2 v2.9.20 => v2.9.21
Joe Mooring [Mon, 2 Aug 2021 14:35:12 +0000 (07:35 -0700)]
deps: Update github.com/tdewolff/minify/v2 v2.9.20 => v2.9.21

Closes #8831

3 years agoFix error handling for the time func alias
Bjørn Erik Pedersen [Sun, 1 Aug 2021 10:50:37 +0000 (12:50 +0200)]
Fix error handling for the time func alias

Fixes #8835

3 years agoFail on invalid time zone
Bjørn Erik Pedersen [Sun, 1 Aug 2021 09:50:12 +0000 (11:50 +0200)]
Fail on invalid time zone

Fixes #8832

3 years agoImprove handling of <nil> Params
Bjørn Erik Pedersen [Fri, 30 Jul 2021 08:56:45 +0000 (10:56 +0200)]
Improve handling of <nil> Params

Fixes #8825

3 years agoMerge branch 'release-0.86.1'
Bjørn Erik Pedersen [Fri, 30 Jul 2021 10:58:26 +0000 (12:58 +0200)]
Merge branch 'release-0.86.1'

3 years agoreleaser: Add release notes for 0.86.1
hugoreleaser [Fri, 30 Jul 2021 10:13:32 +0000 (10:13 +0000)]
releaser: Add release notes for 0.86.1
[ci skip]

3 years agoreleaser: Prepare repository for 0.87.0-DEV
hugoreleaser [Fri, 30 Jul 2021 10:54:50 +0000 (10:54 +0000)]
releaser: Prepare repository for 0.87.0-DEV

[ci skip]

3 years agoreleaser: Add release notes to /docs for release of 0.86.1 v0.86.1
hugoreleaser [Fri, 30 Jul 2021 10:13:32 +0000 (10:13 +0000)]
releaser: Add release notes to /docs for release of 0.86.1

[ci skip]

3 years agoreleaser: Bump versions for release of 0.86.1
hugoreleaser [Fri, 30 Jul 2021 10:13:32 +0000 (10:13 +0000)]
releaser: Bump versions for release of 0.86.1

[ci skip]

3 years agoreleaser: Add release notes for 0.86.1
hugoreleaser [Fri, 30 Jul 2021 10:13:32 +0000 (10:13 +0000)]
releaser: Add release notes for 0.86.1
[ci skip]

3 years agoconfig: Fix a potential deadlock in config reading
Bjørn Erik Pedersen [Fri, 30 Jul 2021 09:53:27 +0000 (11:53 +0200)]
config: Fix a potential deadlock in config reading

Note that the deadlock has not been seen earlier, in tests on in real Hugo sites.

Fixes #8791

3 years agobuild(deps): bump github.com/evanw/esbuild from 0.12.16 to 0.12.17
dependabot[bot] [Fri, 30 Jul 2021 08:16:58 +0000 (08:16 +0000)]
build(deps): bump github.com/evanw/esbuild from 0.12.16 to 0.12.17

Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.12.16 to 0.12.17.
- [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.16...v0.12.17)

---
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/getkin/kin-openapi from 0.67.0 to 0.68.0
dependabot[bot] [Fri, 30 Jul 2021 08:14:53 +0000 (08:14 +0000)]
build(deps): bump github.com/getkin/kin-openapi from 0.67.0 to 0.68.0

Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.67.0 to 0.68.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.67.0...v0.68.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 agotpl/lang: Add new localized versions of lang.FormatNumber etc.
Bjørn Erik Pedersen [Wed, 28 Jul 2021 10:28:52 +0000 (12:28 +0200)]
tpl/lang: Add new localized versions of lang.FormatNumber etc.

Fixes #8820

3 years agoGo back to WARNING for Page deprecations
Bjørn Erik Pedersen [Thu, 29 Jul 2021 14:18:38 +0000 (16:18 +0200)]
Go back to WARNING for Page deprecations

Do that in the next release, let's reduce the noise, we have enough changes as it is.

3 years agoHandle toml.LocalDate and toml.LocalDateTime in front matter
Bjørn Erik Pedersen [Wed, 28 Jul 2021 16:02:42 +0000 (18:02 +0200)]
Handle toml.LocalDate and toml.LocalDateTime in front matter

See #8801

3 years agodeps: Upgrade github.com/pelletier/go-toml/v2 v2.0.0-beta.3 => v2.0.0-beta.3.0.202107...
Bjørn Erik Pedersen [Wed, 28 Jul 2021 15:27:31 +0000 (17:27 +0200)]
deps: Upgrade github.com/pelletier/go-toml/v2 v2.0.0-beta.3 => v2.0.0-beta.3.0.20210727221244-fa0796069526

3 years agoSwitch to go-toml v2
Bjørn Erik Pedersen [Tue, 27 Jul 2021 17:07:10 +0000 (19:07 +0200)]
Switch to go-toml v2

We have been using `go-toml` for language files only. This commit makes it the only TOML library.

It's spec compliant and very fast.

A benchark building a site with 200 pages with TOML front matter:

```bash
name                                  old time/op    new time/op    delta
SiteNew/Regular_TOML_front_matter-16    48.5ms ± 1%    47.1ms ± 1%  -2.85%  (p=0.029 n=4+4)

name                                  old alloc/op   new alloc/op   delta
SiteNew/Regular_TOML_front_matter-16    16.9MB ± 0%    16.7MB ± 0%  -1.56%  (p=0.029 n=4+4)

name                                  old allocs/op  new allocs/op  delta
SiteNew/Regular_TOML_front_matter-16      302k ± 0%      296k ± 0%  -2.20%  (p=0.029 n=4+4)
```

Note that the front matter unmarshaling is only a small part of building a site, so the above is very good.

Fixes #8801

3 years agobuild(deps): bump github.com/tdewolff/minify/v2 from 2.9.19 to 2.9.20
dependabot[bot] [Wed, 28 Jul 2021 08:17:56 +0000 (08:17 +0000)]
build(deps): bump github.com/tdewolff/minify/v2 from 2.9.19 to 2.9.20

Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.9.19 to 2.9.20.
- [Release notes](https://github.com/tdewolff/minify/releases)
- [Commits](https://github.com/tdewolff/minify/compare/v2.9.19...v2.9.20)

---
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 agoAdd a TOML front matter benchmark
Bjørn Erik Pedersen [Tue, 27 Jul 2021 17:24:19 +0000 (19:24 +0200)]
Add a TOML front matter benchmark

3 years agoAdd timezone support for front matter dates without one
Bjørn Erik Pedersen [Tue, 27 Jul 2021 11:45:05 +0000 (13:45 +0200)]
Add timezone support for front matter dates without one

Fixes #8810

3 years agoLocalize time.Format
Bjørn Erik Pedersen [Mon, 26 Jul 2021 16:28:57 +0000 (18:28 +0200)]
Localize time.Format

Fixes #8797