2013-08-17 08:34:25 -04:00
|
|
|
---
|
|
|
|
title: "Homepage Templates"
|
|
|
|
date: "2013-07-01"
|
2014-04-23 03:00:11 -04:00
|
|
|
weight: 30
|
2014-01-28 23:29:05 -05:00
|
|
|
notoc: true
|
2014-04-23 03:00:11 -04:00
|
|
|
menu:
|
|
|
|
main:
|
|
|
|
parent: 'layout'
|
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
|
2014-01-10 21:19:19 -05:00
|
|
|
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).
|
|
|
|
|
2014-01-10 21:19:19 -05:00
|
|
|
It makes use of [chrome templates](/layout/chrome) and uses a [List](/indexes/lists/)
|
2013-08-17 08:34:25 -04:00
|
|
|
|
2014-01-10 21:19:19 -05: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
|
|
|
|
2014-01-10 21:19:19 -05:00
|
|
|
{{ template "chrome/meta.html" . }}
|
2013-08-17 08:34:25 -04:00
|
|
|
|
2014-01-10 21:19:19 -05: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
|
|
|
|
2014-01-10 21:19:19 -05:00
|
|
|
{{ template "chrome/head_includes.html" . }}
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
2013-08-17 08:34:25 -04:00
|
|
|
|
2014-01-10 21:19:19 -05:00
|
|
|
{{ template "chrome/subheader.html" . }}
|
2013-08-17 08:34:25 -04:00
|
|
|
|
2014-01-10 21:19:19 -05:00
|
|
|
<section id="main">
|
|
|
|
<div>
|
|
|
|
{{ range first 10 .Data.Pages }}
|
|
|
|
{{ .Render "summary"}}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
{{ template "chrome/footer.html" }}
|
|
|
|
{{% /highlight %}}
|