From 67209dbfb31550cde05c7f8ea23bf67d9727d855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 22 Jun 2015 20:25:17 +0200 Subject: [PATCH] docs: make the named value Data File example simpler --- docs/content/extras/datafiles.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/extras/datafiles.md b/docs/content/extras/datafiles.md index acf7af610..65a081521 100644 --- a/docs/content/extras/datafiles.md +++ b/docs/content/extras/datafiles.md @@ -88,7 +88,7 @@ Assuming you have the following YAML structure to your `User0123.yml` Data File ``` Name: User0123 -"Short Description": "He is a jolly good fellow." +"Short Description": "He is a **jolly good** fellow." Achievements: - "Can create a Key, Value list from Data File" - "Learns Hugo" @@ -98,7 +98,7 @@ Achievements: To render the `Short Description` in your `layout` File following code is required. ``` -{{ $.Scratch.Set "ShortDesc" ( index $.Site.Data.User0123 "Short Description" ) }} -
Short Description of {{.Site.Data.User0123.Name}}:

{{ $.Scratch.Get "ShortDesc" }}

-{{ end }} +
Short Description of {{.Site.Data.User0123.Name}}:

{{ index .Site.Data.User0123 "Short Description" | markdownify }}

``` + +Note the use of the `markdownify` template function. This will send the description through the Blackfriday Markdown rendering engine. \ No newline at end of file