mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Merge commit 'e509cac533600cf4fa8382c9cdab78ddd82db688'
This commit is contained in:
28
docs/content/en/functions/Render.md
Normal file
28
docs/content/en/functions/Render.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: .Render
|
||||
description: Takes a view to apply when rendering content.
|
||||
categories: [functions]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
aliases: []
|
||||
returnType: template.HTML
|
||||
signatures: [.Render LAYOUT]
|
||||
relatedFunctions: []
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
This function is only available when applied to a single piece of content within a [list context].
|
||||
|
||||
This example could render a piece of content using the content view located at `/layouts/_default/summary.html`:
|
||||
|
||||
```go-html-template
|
||||
{{ range .Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
[list context]: /templates/lists/
|
Reference in New Issue
Block a user