Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
- Loading branch information
Showing
with
385 additions
and 59 deletions.
- +6 −6 common/htime/time_test.go
- +1 −1 docs/content/en/content-management/image-processing/index.md
- +7 −14 docs/content/en/functions/{NumFmt.md → lang.md}
- +1 −0 docs/content/en/functions/time.md
- +80 −12 docs/data/docs.json
- +54 −0 docs/layouts/template-func/page.html
- +1 −1 go.mod
- +2 −0 go.sum
- +49 −0 hugolib/language_test.go
- +3 −3 langs/language.go
- +4 −1 tpl/cast/docshelper.go
- +37 −7 tpl/lang/init.go
- +6 −1 tpl/lang/init_test.go
- +83 −5 tpl/lang/lang.go
- +48 −5 tpl/lang/lang_test.go
- +3 −3 tpl/time/time_test.go
There are no files selected for viewing
| @@ -0,0 +1,54 @@ | ||
| {{ $pkg := .Params.package}} | ||
| {{ $funcs := index site.Data.docs.tpl.funcs $pkg }} | ||
|
|
||
| {{ range $k, $v := $funcs }} | ||
| {{ if $v.Description }} | ||
| {{ $func := printf "%s.%s" $pkg $k }} | ||
| <h2> | ||
| <a class="header-link" href="#{{ $func | anchorize | safeURL }}"> | ||
| <svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"> | ||
| <path d="M0 0h24v24H0z" fill="none"/> | ||
| <path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/> | ||
| </svg> | ||
| </a> | ||
| {{ $func }} | ||
| </h2> | ||
| {{ with $v.Description }} | ||
| <p class="f4 lh-copy"> | ||
| {{ . | $.RenderString | safeHTML }} | ||
| </p> | ||
| {{ end }} | ||
| <h4 class="minor mb3 pt2 primary-color-dark"> | ||
| Syntax | ||
| </h4> | ||
| <div class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;"> | ||
| {{ $pkg }}.{{ $k }} | ||
| {{ with $v.Args }} | ||
| <span class="ttu"> | ||
| {{ delimit $v.Args ", "}} | ||
| </span> | ||
| {{ end }} | ||
| <span></span> | ||
| </div> | ||
| {{ if $v.Examples }} | ||
| <h4 class="minor mb3 pt2 primary-color-dark"> | ||
| Examples | ||
| </h4> | ||
| {{ end }} | ||
| {{ range $v.Examples }} | ||
| {{ $input := index . 0 }} | ||
| {{ $result := index . 1 }} | ||
| {{ $example := printf "%s ---> %s" $input $result }} | ||
|
|
||
| {{ highlight $example "go-html-template" "" }} | ||
| {{ end }} | ||
| {{ with $v.Aliases }} | ||
| <h4 class="minor mb3 pt2 primary-color-dark"> | ||
| Aliases | ||
| </h4> | ||
| <p> | ||
| {{ delimit . ", "}} | ||
| </p> | ||
| {{ end }} | ||
| {{ end }} | ||
| {{ end }} |
Oops, something went wrong.