Created
December 8, 2016 05:19
-
-
Save sagar-ganatra/206ddadf076a8bf48bde159f86e084ca to your computer and use it in GitHub Desktop.
Hugo - Defining home page in layouts directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>{{ .Site.Title }}</title> | |
</head> | |
<body> | |
<nav> | |
{{ range .Site.Pages }} | |
{{ if eq .Type "pages" }} | |
<a href="{{ .Permalink }}">{{ .Title }}</a> | |
{{ end }} | |
{{ end }} | |
<a href="{{ .Site.BaseURL }}">Home</a> | |
</nav> | |
{{ range .Data.Pages }} | |
{{ if or (eq .Type "posts") (eq .Type "posts-series") }} | |
<h3> | |
<a href={{ .Permalink }}>{{ .Title }}</a> | |
</h3> | |
{{ .Render "summary" }} | |
{{ end }} | |
{{ end }} | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment