summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl
AgeCommit message (Collapse)Author
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-04hugolib: Add optional outputFormat to Ref/RelRefBjørn Erik Pedersen
Fixes #3224
2017-04-04tplimpl: Reintroduce the double template lookup in PartialBjørn Erik Pedersen
So it works as before without the html suffix. Fixes #3272
2017-04-04all: Use the configured output types to resolve template typeBjørn Erik Pedersen
Closes #320
2017-04-02tpl: Rework to handle both text and HTML templatesBjørn Erik Pedersen
Before this commit, Hugo used `html/template` for all Go templates. While this is a fine choice for HTML and maybe also RSS feeds, it is painful for plain text formats such as CSV, JSON etc. This commit fixes that by using the `IsPlainText` attribute on the output format to decide what to use. A couple of notes: * The above requires a nonambiguous template name to type mapping. I.e. `/layouts/_default/list.json` will only work if there is only one JSON output format, `/layouts/_default/list.mytype.json` will always work. * Ambiguous types will fall back to HTML. * Partials inherits the text vs HTML identificator of the container template. This also means that plain text templates can only include plain text partials. * Shortcode templates are, by definition, currently HTML templates only. Fixes #3221
2017-04-02Revert "tpl: Rework to handle both text and HTML templates"Bjørn Erik Pedersen
Will have to take another stab at this ... This reverts commit 5c5efa03d2512749950b0d05a7d4bde35ecbdc37. Closes #3260
2017-04-02tplimpl: Add test with failing partialBjørn Erik Pedersen
Main motivation to see that the containing template name is included in the error message name. It is.
2017-04-02tpl: Rework to handle both text and HTML templatesBjørn Erik Pedersen
Before this commit, Hugo used `html/template` for all Go templates. While this is a fine choice for HTML and maybe also RSS feeds, it is painful for plain text formats such as CSV, JSON etc. This commit fixes that by using the `IsPlainText` attribute on the output format to decide what to use. A couple of notes: * The above requires a nonambiguous template name to type mapping. I.e. `/layouts/_default/list.json` will only work if there is only one JSON output format, `/layouts/_default/list.mytype.json` will always work. * Ambiguous types will fall back to HTML. * Partials inherits the text vs HTML identificator of the container template. This also means that plain text templates can only include plain text partials. * Shortcode templates are, by definition, currently HTML templates only. Fixes #3221
2017-03-31tplimpl: Fix map data race in URLLockBjørn Erik Pedersen
2017-03-31tplimpl: Fix deadlock in getJSONBjørn Erik Pedersen
Fixes #3211
2017-03-27tplimpl: Fix lookup with non-standard layout folderBjørn Erik Pedersen
2017-03-27hugolib: Wrap pageOutput create in sync.OnceBjørn Erik Pedersen
2017-03-27Remove the now superflous defaultExtensionBjørn Erik Pedersen
And some other unsed fields and methods.
2017-03-27all: Propagate baseURL error to the callersBjørn Erik Pedersen
2017-03-27hugolib, tplimpl: Use OutputFormats to create atom linksBjørn Erik Pedersen
2017-03-27hugolib: Read default output formats from site configBjørn Erik Pedersen
2017-03-27output: Rework the base template logicBjørn Erik Pedersen
Extract the logic to a testable function and add support for custom output types. Fixes #2995
2017-03-26Revert "tplimpl: return an error on unsupported type in isSet"Bjørn Erik Pedersen
This breaks the theme site and lots of themes, so we will have to thinkg a little harder about this one. This reverts commit 74ea81b885adc64d0194df461cbc85667294d16e.
2017-03-25Change RSS description from full .Content to .SummaryDarwin
2017-03-12tpl: Add union template funcdigitalcraftsman
2017-03-09all: Fix some govet complaintsAlbert Nigmatzianov
2017-03-09tplimpl: Add built-in print funcs to FuncMapCameron Moore
Add print, printf, and println to the Hugo FuncMap so that they are accessible to the apply template func. Updates #3139
2017-03-02tplimpl: return an error on unsupported type in isSetCameron Moore
Fixes #3092
2017-02-25tpl: Add title meta tag to twitter card templatedigitalcraftsman
Fixes #3095
2017-02-21tpl: Use og:updated_time OpenGraph tag on nodesAlan Orth
A previous commit greatly improved the OpenGraph tags generated by Hugo's internal opengraph template, but there was a minor error in the fix. Nodes are of type "website" and according to the Facebook docs they should use og:updated_time. See: https://github.com/spf13/hugo/pull/2979 See: https://developers.facebook.com/docs/reference/opengraph/object-type/website/
2017-02-21tpl, hugolib: Fix live-reload of non-renderable content pagesBjørn Erik Pedersen
Fixes #3062
2017-02-21tpl: Remove twitter:domain tag from internal shortcodeAlan Orth
It seems this metadata tag is no longer used by Twitter, as it has been removed from their Cards Markup Tag Reference since at least 2013 according to a post on the W3 mailing list. See: https://dev.twitter.com/cards/markup See: https://lists.w3.org/Archives/Public/www-validator/2013Oct/0025.html
2017-02-18tplimpl: Fix issue with recursive templatesBjørn Erik Pedersen
Fixes #2927
2017-02-17hugolib: Make RSS item limit configurableCameron Moore
Add a new rssLimit site configuration option with default of 15. Prior to this fix, you could create your own RSS feed to override the default limit of 15, but we still had a hardcoded limit of 50 items set in `hugolib.renderRSS()`. With this option in place, the `range first 15 .Data.Pages` logic is no longer hardcoded into the embedded RSS template. Because the size of the slice passed to the template is now limited to rssLimit instead of 50, this commit is a breaking change for sites with a custom RSS template that expects more than 15 items. Fixes #3035
2017-02-17tplimpl: Fix instagram shortcode panic on invalid IDCameron Moore
Instagram doesn't return a valid JSON response when the requested ID is invalid or not found. Fixes #3048