hugo/tpl/tplimpl
Bjørn Erik Pedersen df11327ba9 Pass .RenderShortcodes' Page to render hooks as .PageInner
The main use case for this is to resolve links and resources (e.g. images) relative to the included `Page`.

A typical `include` would similar to this:

```handlebars
{{ with site.GetPage (.Get 0) }}
  {{ .RenderShortcodes }}
{{ end }}
```

And when used in a Markdown file:

```markdown
{{% include "/posts/p1" %}}
```

Any render hook triggered while rendering `/posts/p1` will get `/posts/p1` when calling `.PageInner`.

Note that

* This is only relevant for shortcodes included with `{{%` that calls `.RenderShortcodes`.
* `.PageInner` is available in all render hooks that, before this commit, received `.Page`.
* `.PageInner` will fall back to the value of `.Page` if not relevant and will always have a value.

Fixes #12356
2024-04-15 09:49:57 +02:00
..
embedded Pass .RenderShortcodes' Page to render hooks as .PageInner 2024-04-15 09:49:57 +02:00
render_hook_integration_test.go tpl/tplimpl: Honor markdown attributes in embedded image render hook 2024-03-07 08:21:58 +01:00
shortcodes.go all: Run gofumpt -l -w . 2024-01-28 23:14:09 +01:00
shortcodes_test.go all: Format code with gofumpt 2020-12-03 13:12:58 +01:00
template.go Create default link and image render hooks 2024-01-30 20:12:19 +01:00
template_ast_transformers.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
template_ast_transformers_test.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
template_errors.go Create default link and image render hooks 2024-01-30 20:12:19 +01:00
template_funcs.go Handle rebuilds when resources passed to transform.Unmarshal etc. changes 2024-02-19 14:50:23 +01:00
template_funcs_test.go tpl/math: Add math.Rand template function 2023-12-29 19:37:27 +01:00
template_test.go Fix base template handling with preceding comments 2020-01-30 23:44:42 +01:00
templateFuncster.go Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
templateProvider.go Create a struct with all of Hugo's config options 2023-05-16 18:01:29 +02:00
tplimpl_integration_test.go tpl/tplimpl: Optionally exclude content from sitemap 2024-04-02 11:21:03 +02:00