--- title: "Content Templates" date: "2013-07-01" menu: main: parent: 'layout' --- Content templates are created in a directory matching the name of the content. Content pages are of the type "page" and have all the [page variables](/layout/variables/) available to use in the templates. In the following examples we have created two different content types as well as a default content type. ▾ layouts/ ▾ post/ single.html ▾ project/ single.html Hugo also has support for a default content template to be used in the event that a specific template has not been provided for that type. The default type works the same as the other types but the directory must be called "_default". [Content views](/layout/views) can also be defined in the "_default" directory. ▾ layouts/ ▾ _default/ single.html ## post/single.html This content template is used for [spf13.com](http://spf13.com). It makes use of [chrome templates](/layout/chrome) {{ template "chrome/header.html" . }} {{ template "chrome/subheader.html" . }} {{ $baseurl := .Site.BaseUrl }}

{{ .Title }}

{{ .Content }}
{{ template "chrome/disqus.html" . }} {{ template "chrome/footer.html" . }} ## project/single.html This content template is used for [spf13.com](http://spf13.com). It makes use of [chrome templates](/layout/chrome) {{ template "chrome/header.html" . }} {{ template "chrome/subheader.html" . }} {{ $baseurl := .Site.BaseUrl }}

{{ .Title }}

{{ .Content }}
{{if isset .Params "project_url" }}
Fork me on GitHub
{{ end }} {{ template "chrome/footer.html" }} Notice how the project/single.html template uses an additional parameter unique to this template. This doesn't need to be defined ahead of time. If the key is present in the front matter than it can be used in the template.