summaryrefslogtreecommitdiffstats
path: root/tpl/time
AgeCommit message (Collapse)Author
2023-05-16Create a struct with all of Hugo's config optionsBjørn Erik Pedersen
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
2023-02-25Add a page template funcBjørn Erik Pedersen
Fixes #9339
2022-05-08Use configured timeZone for the clockBjørn Erik Pedersen
And some other related adjustments. Updates #8787
2022-05-08Add `clock` cli flagsatotake
Close #8787
2022-05-06tpl: Improve godocBjørn Erik Pedersen
2022-04-05Localize all the GroupBy*Date methodsBjørn Erik Pedersen
Fixes #9745
2022-03-17all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2022-02-24Add Markdown diagrams and render hooks for code blocksBjørn Erik Pedersen
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`). We also used this new hook to add support for diagrams in Hugo: * Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams. * Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information. Updates #7765 Closes #9538 Fixes #9553 Fixes #8520 Fixes #6702 Fixes #9558
2021-10-30tpl/time: Use configured location when date passed to Format is stringBjørn Erik Pedersen
Updates #9084
2021-08-10Revert "tpl/time: Handle nil values in time.AsTime"Bjørn Erik Pedersen
This reverts commit 3e11072892ca31bb76980ee38890a4bd92d83dfd.
2021-08-09tpl/time: Handle nil values in time.AsTimeBjørn Erik Pedersen
Closes #8865
2021-08-03tpl/time: Adjust tests to handle matching local time zonesBjørn Erik Pedersen
Closes #8843
2021-08-02Reduce binary size vs locale, update to CLDR v36.1Bjørn Erik Pedersen
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
2021-08-01Fix error handling for the time func aliasBjørn Erik Pedersen
Fixes #8835
2021-07-29tpl/lang: Add new localized versions of lang.FormatNumber etc.Bjørn Erik Pedersen
Fixes #8820
2021-07-28Handle toml.LocalDate and toml.LocalDateTime in front matterBjørn Erik Pedersen
See #8801
2021-07-27Add timezone support for front matter dates without oneBjørn Erik Pedersen
Fixes #8810
2021-07-27Localize time.FormatBjørn Erik Pedersen
Fixes #8797
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-10-21tpl: Refactor time.AsTime location implementationCameron Moore
2020-10-21tpl: Update Hugo time to support optional [LOCATION] parameterMark Johnson
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2018-11-30tpl: Add godoc packages commentsCameron Moore
Also fix package name in tpl/templates.
2017-09-09tpl/time: Add time.Duration and time.ParseDuration template funcsBjørn Erik Pedersen
And with time.Duration with the convenient alias `duration`: ``` {{ mul 60 60 | duration "second" }} ``` Fixes #3828
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-05-20tpl/time: Re-add the time exampleBjørn Erik Pedersen
2017-05-20tpl: Make the Namespace func signature explicitBjørn Erik Pedersen
This makes it cleaner and avoids breaking client code, such as the docs helper JSON generator.
2017-05-20tpl/time: Remove asTime template func mappingCameron Moore
2017-05-20tpl/time: Support overlapping namespace and template funcCameron Moore
Fixes #3421
2017-05-02tpl: Add basic tests for all namespace init funcsCameron Moore
2017-05-01tpl: Add docshelper for template funcsBjørn Erik Pedersen
And fix some other minor related issues. Updates #3418
2017-05-01tpl: Fix the remaining template funcs namespace issuesBjørn Erik Pedersen
See #3042
2017-05-01tpl/time: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-04-30tpl: Add template function namespacesCameron Moore
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