hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit be778c31606b08e7320cafb6082700e4240be2fd
parent be1366074c13a29b5c493cf5641c917f0a00a291
Author: bep <bjorn.erik.pedersen@gmail.com>
Date:   Fri, 22 May 2015 23:43:12 +0200

docs: some more on absURL, relURL

Diffstat:
Mdocs/content/templates/functions.md | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md
@@ -440,8 +440,26 @@ Both `absURL` and `relURL` considers the configured value of `baseURL`, so given
 
 * `{{ "mystyle.css" | absURL }}` → "http://mysite.com/hugo/mystyle.css"
 * `{{ "mystyle.css" | relURL }}` → "/hugo/mystyle.css"
+* `{{ "http://gohugo.io/" | relURL }}` →  "http://gohugo.io/"
+* `{{ "http://gohugo.io/" | absURL }}` →  "http://gohugo.io/"
 
-**Note:** If `canonifyUrls` is enabled, the last example above will be "/mystyle.css". These functions are smart about missing slashes, but will not add one to the end if not present.
+The last two examples may look funky, but is useful if you, say, have a list of images, some of them hosted externally, some locally:
+
+```
+<script type="application/ld+json">
+{
+    "@context" : "http://schema.org",
+    "@type" : "BlogPosting",
+    "image" : {{ apply .Params.images "absURL" "." }}
+}
+</script>
+```
+
+The above also exploits the fact that the Go template parser JSON-encodes objects inside `script` tags.
+
+
+
+**Note:** These functions are smart about missing slashes, but will not add one to the end if not present.
 
 
 ### ref, relref