Age | Commit message (Collapse) | Author |
|
There are currently several Params and case related issues floating around in Hugo.
This is very confusing for users and one of the most common support questions on the forum.
And while there have been done some great leg work in Viper etc., this is of limited value since this and similar doesn't work:
`Params.myCamelCasedParam`
Hugo has control over all the template method invocations, and can take care of all the lower-casing of the map lookup keys.
But that doesn't help with direct template lookups of type `Site.Params.TWITTER_CONFIG.USER_ID`.
This commit solves that by doing some carefully crafted modifications of the templates' AST -- lowercasing the params keys.
This is low-level work, but it's not like the template API wil change -- and this is important enough to defend such "bit fiddling".
Tests are added for all the template engines: Go templates, Ace and Amber.
Fixes #2615
Fixes #1129
Fixes #2590
|
|
Was removed by mistake.
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Some sites, Hugo docs included, have faulty alias definitions that point
to itself or another real page. These will be overwritten in the next step.
This is how it behaves in Hugo 0.17, too.
Updates #2297
|
|
Updates #2297
|
|
Returning all types is both confusing and too breaking.
All page types can be fetched in .Site.Pages.
Updates #2297
|
|
Updates #2297
|
|
By embeding the init sync.Once var in a pointer so we can reset it when we copy the page.
Updates #2297
|
|
Updates #2297
|
|
This includes removing the error return value from Permalink and RelPermalink.
We ignore that error all over the place, so we might as well remove it.
Updates #2297
|
|
And misc. TODO-fixes
Updates #2297
|
|
Having a custom string type isn't worth it when it doesn't work
with `where`, `eq` etc.
Fixes #2689
Updates #2297
|
|
And embed that on Page.
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
As an alias to .Data.Pages for home page etc.
Also renamte NodeType to PageType and make it a string so it can be used in `where`.
Updates #2297
|
|
* `.Site.Pages` now contains all page types, including sections etc.
* `.Data.Pages` will also contain "node type" pages where relevant.
Updates #2297
|
|
To make it easier to follow and understand.
Both building and rebuilding now follow a four step flow:
1. Init
2. Process
3. Assemble
4. Render
And now there are only one Build method, used for both builds and rebuilds.
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
Fixes #1303
|
|
Because that will overwrite the home page, which is bad.
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
Updates #2297
|
|
With refactored paginator handling.
Updates #2297
|
|
Updates #2297
|
|
This reverts commit 239c75c7f866e8970b794a9e7bac73de46052241.
There is a ininite loop in there somewhere on my site that needs to be resolved.
|
|
There are currently several Params and case related issues floating around in Hugo.
This is very confusing for users and one of the most common support questions on the forum.
And while there have been done some great leg work in Viper etc., this is of limited value since this and similar doesn't work:
`Params.myCamelCasedParam`
Hugo has control over all the template method invocations, and can take care of all the lower-casing of the map lookup keys.
But that doesn't help with direct template lookups of type `Site.Params.TWITTER_CONFIG.USER_ID`.
This commit solves that by doing some carefully crafted modifications of the templates' AST -- lowercasing the params keys.
This is low-level work, but it's not like the template API wil change -- and this is important enough to defend such "bit fiddling".
Tests are added for all the template engines: Go templates, Ace and Amber.
Fixes #2615
Fixes #1129
Fixes #2590
|
|
Fixes #2709
|
|
Add imageConfig function which calls image.DecodeConfig and returns the height, width and color mode of the image. (#2677)
This allows for more advanced image shortcodes and templates such as those required by AMP.
layouts/shortcodes/amp-img.html
```
{{ $src := .Get "src" }}
{{ $config := imageConfig (printf "/static/%s" $src) }}
<amp-img src="{{$src}}"
height="{{$config.Height}}"
width="{{$config.Width}}"
layout="responsive">
</amp-img>
```
|
|
|
|
* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
|
|
Fixes #2673
|
|
|
|
This commit adds a `GitInfo` object to `Page` if `EnableGitInfo` is set.
It then also sets `Lastmod` for the given `Page` to the author date provided by Git.
The Git integrations should be fairly performant, but it adds "some time" to the build, somewhat depending on the Git history size.
If you want, you can run without during development and turn it on when deploying to the live server: `hugo --enableGitInfo`.
Fixes #2102
|