From 8262b077c6ca7fdcb36c95698c409438a400fed2 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Tue, 30 Nov 2021 08:24:56 -0800 Subject: [PATCH] Improve inline resource examples (#1587) --- content/en/content-management/page-resources.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/content/en/content-management/page-resources.md b/content/en/content-management/page-resources.md index 8bf8a37c8..9f2c0cfab 100644 --- a/content/en/content-management/page-resources.md +++ b/content/en/content-management/page-resources.md @@ -60,7 +60,22 @@ RelPermalink : The relative URL to the resource. Resources of type `page` will have no value. Content -: The content of the resource itself. For most resources, this returns a string with the contents of the file. This can be used to inline some resources, such as `` or ``. +: The content of the resource itself. For most resources, this returns a string +with the contents of the file. Use this to create inline resources. + +```go-html-template +{{ with .Resources.GetMatch "script.js" }} + +{{ end }} + +{{ with .Resources.GetMatch "style.css" }} + +{{ end }} + +{{ with .Resources.GetMatch "img.png" }} + +{{ end }} +``` MediaType : The MIME type of the resource, such as `image/jpeg`.