June 9, 2014 0 minutes and 15 seconds read

Skip a contenttype/section to be renderend

When creating a layout it may occur that you want to skip rendering certain types of content, or render only specific content in a part of your layout.

Example: You want to only render contenttype ‘post’ use the following code in your template:

{{ if eq .Type "post" }}

    {{ .Title }}
    {{ .Content }}

{{ end }}