$ hugo env
Hugo Static Site Generator v0.35-DEV linux/amd64 BuildDate:
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.9.2"
I got these files:
// layouts/_default/baseof.ace
= doctype html
html lang={{ .Site.Language.Lang }}
{{- partial "head" . -}}
body
{{ block "header" . }}
header
h1 {{ .Title }}
{{ end }}
{{ block "main" . }}
/ The main content is here
{{ end }}
// layouts/partials/head.ace
head
meta charset=utf-8
meta http-equiv=x-ua-compatible content="ie=edge"
meta name=viewport content="width=device-width, initial-scale=1"
title {{- .Title | default .Site.Title -}}
// layout/partials/nav.ace
nav
p nav
// layouts/index.ace
{{ define "header" }}
p
this is the header
{{ end }}
{{ partial "nav" . }}
{{ define "main" }}
p this is main
{{ end }}
But unfortunately the index page being generated looks like this
Is it possible that by “index page” you mean the home page? the name should then be home.ace. If it’s an overview it should be list.ace. Just guessing here, my own home page lies in /page/home.html.
If you “index page” has frontmatter telling it to use “layout: index” it should work the way you structured.
The OP is talking about the layout files. So the naming looks right. The web site home page is rendered from index.html, or in OP’s case index.ace. You then don’t need to set the layout manually in the front-matter.
Yes, that was my next step, I inferred wrongly that since {{ partial “something” . }} was equivalent to = include partials/something.ace . then {{ block “something” . }}{{ end }} was going to be equivalent to = yield something.