Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
AgeCommit message (Collapse)Author
2021-11-01Fix description of lang.FormatNumberCustomJoe Mooring
It currently refers to itself as a simple alternative, when it should refer to lang.FormatNumber.
2021-11-01Update Twitter shortcode oEmbed endpointJoe Mooring
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
2021-10-30tpl/time: Use configured location when date passed to Format is stringBjørn Erik Pedersen
Updates #9084
2021-10-05tpl/path: Add path.CleanBrad
Fixes #8885
2021-09-22Clarify "precision" in currency format functionsPaul Gottschling
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
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-04parser: Indent TOML tablesBjørn Erik Pedersen
Fixes #8850
2021-08-03Fix `lang.FormatPercent` descriptionSalim B
Successor PR for https://github.com/gohugoio/hugoDocs/pull/1504
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-28Switch to go-toml v2Bjørn Erik Pedersen
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
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
2021-07-15hugofs: Make FileMeta a structBjørn Erik Pedersen
This commit started out investigating a `concurrent map read write` issue, ending by replacing the map with a struct. This is easier to reason about, and it's more effective: ``` name old time/op new time/op delta SiteNew/Regular_Deep_content_tree-16 71.5ms ± 3% 69.4ms ± 5% ~ (p=0.200 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_Deep_content_tree-16 29.7MB ± 0% 27.9MB ± 0% -5.82% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_Deep_content_tree-16 313k ± 0% 303k ± 0% -3.35% (p=0.029 n=4+4) ``` See #8749
2021-07-05Fix tab selection of disabled items in internal pagination templateRaoul
2021-06-29Fix date format in schema and opengraph templatesJoe Mooring
Fixes #8671
2021-06-18tpl: Rename err-missing-instagram-accesstoken => ↵Bjørn Erik Pedersen
error-missing-instagram-accesstoken To get it in line with the other.
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2021-06-08docs: Regenerate docs helperBjørn Erik Pedersen
2021-06-08tpl: Add a terse pagination template variant to improve performanceJoe Mooring
These calls are equivalent: {{ template "_internal/pagination.html" . }} {{ template "_internal/pagination.html" (dict "page" .) }} {{ template "_internal/pagination.html" (dict "page" . "format" "default") }} To use an alternate format: {{ template "_internal/pagination.html" (dict "page" . "format" "terse") }} Fixes #8599
2021-06-08Upgrade Instagram shortcodeBjørn Erik Pedersen
Fixes #7879
2021-06-07tpl/fmt: Add erroridf template funcBjørn Erik Pedersen
Fixes #8613
2021-06-07tpl/data: Print response body on HTTP errorsBjørn Erik Pedersen
Which makes it easier to debug.
2021-06-06tpl/data: Misc header improvements, tests, allow multiple headers of same keyBjørn Erik Pedersen
Closes #5617
2021-06-06tpl/data: Allows user-defined HTTP headers with getJSON and getCSVPaul Chamberlain
Updates #5617
2021-05-28Add math.Max and math.MinJoe Mooring
Closes #8583
2021-05-09tpl: Allow 'Querify' to take lone slice/interface argumentUjjwal Goyal
Querify can now take a lone string/interface slice (with string keys) as a parameter, or multiple string parameters, to build URL queries. Querify earlier used 'Dictionary' to add key/value pairs to a map to build URL queries. Changed to dynamically generate ordered key/value pairs. Cannot take string slice as key (earlier possible due to Dictionary). Added tests and benchmarks for querify. Closes #6735
2021-05-03tpl: Fix countwords to handle special charsJulien Midedji
Fixes #8479
2021-04-30deps: Update getkin/kin-openapi v0.60.0 => v0.61.Bjørn Erik Pedersen
2021-04-29Remove .Site.Authors from embedded templatesJoe Mooring
Closes #4458
2021-04-23tpl/collections: Fix where on type mismatchesBjørn Erik Pedersen
Fixes #8353
2021-04-23Make the shortcode template lookup for output formats stableBjørn Erik Pedersen
Fixes #7774
2021-04-21Fix Params case handling in where with slices of structs (e.g. Pages)Bjørn Erik Pedersen
Fixes #7009
2021-04-15Remove extraneous space from figure shortcodeJoe Mooring
Fixes #8401
2021-03-30tpl: Remove the FuzzMarkdownify func for nowBjørn Erik Pedersen
It has gotten us nothing but "build fails" mail and work we don't have time to follow up on.
2021-03-28Try to fix the fuzz buildBjørn Erik Pedersen
2021-03-14media: Make Type comparableBjørn Erik Pedersen
So we can use it and output.Format as map key etc. This commit also fixes the media.Type implementation so it does not need to mutate itself to handle different suffixes for the same MIME type, e.g. jpg vs. jpeg. This means that there are no Suffix or FullSuffix on media.Type anymore. Fixes #8317 Fixes #8324
2021-03-03Add support for Google Analytics v4Daniel Atwood
2021-02-23tpl: Add method mappings for strings.Contains, strings.ContainsAnyBjørn Erik Pedersen
Just to confirm/document the function signature.
2021-02-18tpl: Make the build green againBjørn Erik Pedersen
2021-02-18tpl: Regenerate internal templatesBjørn Erik Pedersen
2021-02-18tpl: Update date logic of opengraph and schema internal templatesDaniel Atwood
* Fix: updated date logic in opengraph template * Updated date logic in schema template * Reformatted opengraph and schema * Wrapped PublishDate and Lastmod in with
2021-02-18tpl: Add temporary patch to fix template data raceBjørn Erik Pedersen
Keep this as a separate commit so we can reapply it if needed. Fixes #7293
2021-02-18Add breaking tests for "map read and map write in templates"Bjørn Erik Pedersen
The fix upstream in Go was reverted, so we apply a temporary patch for this in Hugo. Updates #7293
2021-02-18Pull in latest Go template sourceBjørn Erik Pedersen
2021-02-18tpl/internal: Synch Go templates fork with Go 1.16devBjørn Erik Pedersen