hugo/resources
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
..
assets Create a struct with all of Hugo's config options 2023-05-16 18:01:29 +02:00
images resources/images: Retain newlines with text overlays 2024-03-07 09:52:30 +01:00
internal all: Fix typos 2024-02-11 13:51:33 +02:00
jsconfig all: Fix typos in function names and comments 2023-06-19 09:26:29 +02:00
kinds all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
page Pass .RenderShortcodes' Page to render hooks as .PageInner 2024-04-15 09:49:57 +02:00
postpub all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
resource Fix Name for nested resourced fetched in resources.ByName and similar 2024-03-13 18:59:50 +02:00
resource_factories resources: Use different cache key when copying resources 2024-03-27 09:59:59 +01:00
resource_transformers babel: Run go fmt 2024-04-08 18:28:04 +02:00
testdata Add images.Opacity filter 2023-09-22 15:03:16 +02:00
docs.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
errorResource.go all: Typo fixes 2024-04-11 09:23:17 +02:00
image.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
image_cache.go Fix multihost processed image not copied to non-default content languages 2024-02-27 10:43:23 +01:00
image_extended_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
image_test.go testing: Set usesFMA as true for riscv64 too 2024-03-20 08:59:13 +01:00
post_publish.go Add basic "post resource publish support" 2020-04-07 21:59:20 +02:00
resource.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
resource_cache.go Fix rebuild with resources.Concat 2024-02-16 13:17:53 +01:00
resource_metadata.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
resource_spec.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
resource_spec_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
resources_integration_test.go resources: Use different cache key when copying resources 2024-03-27 09:59:59 +01:00
testhelpers_test.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
transform.go resource: Revert the normalization of Resource.Name 2024-02-25 14:57:29 +01:00
transform_integration_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
transform_test.go all: Fix typos and some URLs 2024-02-18 12:16:30 +01:00