Age | Commit message (Collapse) | Author |
|
It currently refers to itself as a simple alternative, when it should
refer to lang.FormatNumber.
|
|
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
|
|
Successor PR for https://github.com/gohugoio/hugoDocs/pull/1504
|
|
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
|
|
Fixes #8835
|
|
Fixes #8820
|
|
See https://github.com/mvdan/gofumpt
|
|
Fixes #5242
|
|
strconv.FormatFloat doesn't round properly sometimes, this adds a
different method of rounding, fixes #7116
|
|
|
|
Also fix package name in tpl/templates.
|
|
The original implementation of NumFmt did not take into account that the
options delimiter (a space) could be a valid option. Adding a delim
parameter seems like the simplest, safest, and most flexible way to
solve this oversight in a backwards-compatible way.
Fixes #5260
|
|
|
|
As an example:
```html
{{ $pages := .Site.RegularPages | lang.Merge $frSite.RegularPages | lang.Merge $enSite.RegularPages }}
```
Will "fill in the gaps" in the current site with, from left to right, content from the French site, and lastly the English.
Fixes #4463
|
|
|
|
|
|
This makes it cleaner and avoids breaking client code, such as the docs helper JSON generator.
|
|
NumFmt formats a number with a given precision using the requested
decimal, grouping, and negative characters.
Fixes #1444
|
|
|
|
And fix some other minor related issues.
Updates #3418
|
|
See #3042
|
|
As a first step to remove the hard ties between `tplimpl` and the different namespace packages.
The `lang` package is used as the first example use case.
See #3042
|
|
This commit moves almost all of the template functions into separate
packages under tpl/ and adds a namespace framework. All changes should
be backward compatible for end users, as all existing function names in
the template funcMap are left intact.
Seq and DoArithmatic have been moved out of the helpers package and into
template namespaces.
Most of the tests involved have been refactored, and many new tests have
been written. There's still work to do, but this is a big improvement.
I got a little overzealous and added some new functions along the way:
- strings.Contains
- strings.ContainsAny
- strings.HasSuffix
- strings.TrimPrefix
- strings.TrimSuffix
Documentation is forthcoming.
Fixes #3042
|