I created two test pages in the main directory, in /content using html files (index.html and test.html).
My issue is:
[...]
WARN: 2016/09/08 17:45:36 site.go:2004: "" is rendered empty
ERROR: 2016/09/08 17:45:36 general.go:212: Error while rendering homepage: template: theme/index.html:7:14: executing "theme/index.html" at <.Content>: can't evaluate field Content in type *hugolib.Node
0 draft content
0 future content
0 expired content
2 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 19 ms
[...]
The rendered page is cutted after .Title
I am not sure if i am just doing it wron or if it is an valid issue.
Sorry if i just doing it wrong.
Yes, that works, but I’m not sure that is what thread starter wants.
/layouts/index.html, aka the home page, is usually used to list pages (title, summary). There are plenty of examples in the themes floating around of how to do this.
there are two types of templates in Hugo: pages and nodes. pages are used to render the content files, therefore you can access a variable called .Content.
Every other page is a node, like the homepage, which will rendered with the index.html theme. Those pages aren’t associated with any content and don’t have the same-named variable. What would it contain?
I suggest to follow @sethm’s linked comment. Currently, it’s a common practice to range over all pages and filter them. Now you’re working with pages and you’ve access to the content variable.