summaryrefslogtreecommitdiffstats
path: root/tpl
AgeCommit message (Collapse)Author
2017-06-13Run gofmt to get imports in line vs gohugoio/hugoBjørn Erik Pedersen
2017-06-13all: Update textual references in Go source to point to gohugoio/hugoBjørn Erik Pedersen
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-06-08tpl/collections: Add uint support to InCameron Moore
2017-06-08tpl/collections: Support interfaces in unionCameron Moore
Fixes #3411
2017-06-03tpl: Add uniq functionNathan Sharfi
2017-05-22tpl/cast: Handle template.HTML and friends in ToIntCameron Moore
Also add tests for ToInt and ToString. Resolves #3308
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-19tpl/collections: Make IsSet WARNING less chattyBjørn Erik Pedersen
Updates #3092
2017-05-18tpl/images: Fix error handling in ConfigBjørn Erik Pedersen
2017-05-18tpl/collections: Use Feedback log instead of Error in IsSetCameron Moore
Using the Error log will cause Hugo to exit with an error, which could break site build workflows.
2017-05-18tpl/collections: Log an error on unsupported types in IsSetCameron Moore
Unsupported types are currently silently ignored by IsSet. An earlier attempt was made to solve the issue by returning an error. That attempt was reverted since it broke some existing themes. So instead, we'll log an error. Hopefully, people will stop using IsSet in this way, and we can eventually return an error outright. Updates #3092
2017-05-18tpl/collections: Add support for interfaces to intersectCameron Moore
Fixes #1952
2017-05-18tpl/lang: Add NumFmt functionCameron Moore
NumFmt formats a number with a given precision using the requested decimal, grouping, and negative characters. Fixes #1444
2017-05-17tmplimpl: Add support for ellipsed paginatorBjørn Erik Pedersen
Fixes #3466
2017-05-13hugolib: Handle shortcode per output formatBjørn Erik Pedersen
This commit allows shortcode per output format, a typical use case would be the special AMP media tags. Note that this will only re-render the "overridden" shortcodes and only in pages where these are used, so performance in the normal case should not suffer. Closes #3220
2017-05-04tpl: Add some GoDoc info to template func docsBjørn Erik Pedersen
Closes #3418
2017-05-02tpl/urls: Make urlize return a stringBjørn Erik Pedersen
Like it did in 0.20.
2017-05-02tpl/data: Clean up data namespaceCameron Moore
- Move the main GetCSV and GetJSON into data.go. - Add error returns to GetCSV and GetJSON. - Add http client to Namespace for test mocking. - Send accept headers on remote requests. Fixes #3395 - Return an error on non-2XX HTTP response codes and don't retry. - Move cache tests to cache_test.go.
2017-05-02tpl/data: Move cache logic to separate fileCameron Moore
2017-05-02tpl/data: Shorten some internal func namesCameron Moore
2017-05-02tpl/images: Fix embedded sync.MutexCameron Moore
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/partials: Remouve unused methodBjørn Erik Pedersen
2017-05-01tpl: Fix the remaining template funcs namespace issuesBjørn Erik Pedersen
See #3042
2017-05-01 tpl/urls: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/transform: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/time: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/safe: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/os: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/inflect: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/images: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/encoding: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/crypto: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/collections: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/compare: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/data: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/strings: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl/math: Make it a package that stands on its ownBjørn Erik Pedersen
See #3042
2017-05-01tpl: Add TemplateFuncsNamespaceRegistryBjørn Erik Pedersen
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
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
2017-04-22tplimpl: Add translation links to the default sitemap templateJack Taylor
For pages with translations, add links with hreflang attributes to the default sitemap template. This helps Google to show the correct language page in its search results. The syntax used is based on Google's example at [1]. Also update the sitemap template docs to reflect the changes in the default template. [1] https://support.google.com/webmasters/answer/2620865?hl=en&topic=2370587&ctx=topic Fixes #2569
2017-04-16tplimpl: Allow text partials in HTML templatesBjørn Erik Pedersen
Most obvius benefit of this is to include CSS partials with css file suffix into HTML templates. A valid workaround would be to rename the file `mystyles.html`, but that doesn't work too good for external editors etc. The css partial is a method used in some themes before Hugo 0.20, but then it stopped working. This commit reintroduces that behaviour. Note that the regular layout lookups for text templates, i.e. "single.json" will be prefixed with "_text/" on lookup and will only match in the text collection. Fixes #3273
2017-04-13output: Fix base theme vs project base template logicBjørn Erik Pedersen
Fixes #3323
2017-04-06tpl: Set RenderingContext.Config in markdownifyAlbert Nigmatzianov
2017-04-05tpl: Fix nil pointer in Tree()Bjørn Erik Pedersen
Fixes #3285