hugo

Fork of github.com/gohugoio/hugo with reverse pagination support

git clone git://git.shimmy1996.com/hugo.git

render.md (822B)

    1 ---
    2 title: .Render
    3 description: Takes a view to apply when rendering content.
    4 date: 2017-02-01
    5 publishdate: 2017-02-01
    6 lastmod: 2017-02-01
    7 categories: [functions]
    8 menu:
    9   docs:
   10     parent: "functions"
   11 keywords: [views]
   12 signature: [".Render LAYOUT"]
   13 workson: []
   14 hugoversion:
   15 relatedfuncs: []
   16 deprecated: false
   17 aliases: []
   18 ---
   19 
   20 The view is an alternative layout and should be a file name that points to a template in one of the locations specified in the documentation for [Content Views](/templates/views).
   21 
   22 This function is only available when applied to a single piece of content within a [list context][].
   23 
   24 This example could render a piece of content using the content view located at `/layouts/_default/summary.html`:
   25 
   26 ```
   27 {{ range .Pages }}
   28     {{ .Render "summary"}}
   29 {{ end }}
   30 ```
   31 
   32 [list context]: /templates/lists/