bep
8ad9c0a7dd
Make Where template-method accept methodname as key
...
This is necessary to make constructs like `{{ range first 1 (where .Data.Pages "Type" "post") }}` -- as Type and Section is methods not fields.
2014-11-13 12:42:26 -05:00
Austin Ziegler
d7e6e490c2
Allow partial without .html
...
`partial "header" .` means the same thing as `partial "header.html" .`.
2014-11-13 12:30:45 -05:00
Tatsushi Demachi
af47e5a2cf
Extend template's mod and modBool functions to accept any int types
...
Fixes #575
2014-11-01 23:00:46 -04:00
bep
da5d98e958
Make First accept any int
...
TOML and YAML handles integers differently, creating issues when using integer values from configuration or front matter in the First template function.
This currently works in YAML (parses into int), but not in TOML (parses into int64).
This commit modifies First so it accepts any int.
Fixes #551
2014-10-15 12:39:09 -04:00
bep
16330cea91
Add nil-check to Intersect
...
The Intersect template-method would fail if one or both of the lists were nil (post vs page; post has tags, page has not).
This commit adds a nil-check and returns an empty result if any of the inputs are nil.
See #537
2014-10-15 12:31:22 -04:00
Will Stevens
938733f48f
added In and Intersect template functions
2014-10-07 16:52:12 -04:00
spf13
e3d4d40d32
better error messages for template errors
2014-10-02 13:37:38 -04:00
Tatsushi Demachi
5d565c34e5
Extend template's basic math functions to accept float, uint and string values
2014-09-22 09:01:40 -04:00
Joel Scoble
becd4fe337
refactor handling of amber to AddTemplateFile as the TODO note stated. Used switch statement to make it easier to add other template support
2014-09-11 17:09:16 -04:00
spf13
1b7f18e391
Making partials context optional for compatibility with template.
...
If not provided, context is nil.
2014-09-03 11:30:08 -04:00
Tatsushi Demachi
002a5b6756
Add 'where' template function
2014-08-18 11:31:17 -04:00
spf13
c297d7451f
Adding 'partial' template function to add theme / local awareness to the partials directory.
2014-06-06 16:15:19 -04:00
Vincent Batoufflet
73cbefdbc8
Make template comparison functions handle floats
2014-05-10 15:38:18 -04:00
Vincent Batoufflet
179225449c
Add template comparison functions (Go 1.1 compat)
2014-05-09 22:42:28 -04:00
spf13
4a8de8ea46
Add Disqus support out of the box. Move template/bundle into hugolib.
2014-04-23 02:53:12 -04:00
Noah Campbell
79d9f82e79
Code reorg, helpers.go has been decomposed.
...
It started with wanting to move templates in template bundles and the
rest followed. I did my best to start grouping related functions
together, but there are some that I missed. There is also the method
Urlize that seems to be a special function used in both worlds. I'll
need to revisit this method.
2013-09-03 16:16:07 -07:00
Noah Campbell
3ecc698f5e
Remove hugolib.HTML and hugolib.URL types
...
These types were not be rendered correctly by the html/template package.
Removing them gets the correct behavior.
Fixes #74
2013-09-03 12:43:56 -07:00
Fabrizio (Misto) Milo
ba82a20321
Add support for amber files
...
If a layout file ends with .amber it will interpreted as a Amber file
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-01 19:51:32 -07:00
Fabrizio (Misto) Milo
ee5865f239
Abstract html/template dependency
...
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-01 19:51:27 -07:00