hugo/docs/content/layout/homepage.md

58 lines
1.5 KiB
Markdown
Raw Normal View History

2013-08-17 08:34:25 -04:00
---
title: "Homepage Templates"
date: "2013-07-01"
groups: ["layout"]
groups_weight: 30
notoc: true
2013-08-17 08:34:25 -04:00
---
Home pages are of the type "node" and have all the [node
variables](/layout/variables/) available to use in the templates.
*This is the only required template for building a site and useful when
bootstrapping a new site and template.*
In addition to the standard node variables, the homepage has access to
all site content accessible from .Data.Pages . Details on how to use this
list of pages can be found in [Lists](/indexes/lists/)
2013-08-17 08:34:25 -04:00
▾ layouts/
index.html
## example index.html
This content template is used for [spf13.com](http://spf13.com).
It makes use of [chrome templates](/layout/chrome) and uses a [List](/indexes/lists/)
2013-08-17 08:34:25 -04:00
{{% highlight html %}}
<!DOCTYPE html>
<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
<meta charset="utf-8">
2013-08-17 08:34:25 -04:00
{{ template "chrome/meta.html" . }}
2013-08-17 08:34:25 -04:00
<base href="{{ .Site.BaseUrl }}">
<title>{{ .Site.Title }}</title>
<link rel="canonical" href="{{ .Permalink }}">
<link href="{{ .RSSlink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
2013-08-17 08:34:25 -04:00
{{ template "chrome/head_includes.html" . }}
</head>
<body lang="en">
2013-08-17 08:34:25 -04:00
{{ template "chrome/subheader.html" . }}
2013-08-17 08:34:25 -04:00
<section id="main">
<div>
{{ range first 10 .Data.Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{ template "chrome/footer.html" }}
{{% /highlight %}}