Hello
I would like my home page (index.html
) to be the latest page (according to date
in the front matter). In other words, if the page hello.md
is the most recent one, going to http://mysite.org/
(= http://mysite.org/index.html
) should yield http://mysite.org/hello.html
I know how to render the content of the most recent page:
{{ range first 1 .Data.Pages.ByDate.Reverse }}
{{ .Content }}
{{ end }}
but this just renders the content, without the surrounding elements found in single.html
.
I could of course copy single.html
into index.html
and adapt the content rendering per above, but this means maintaining two otherwise identical pages.
Is there a way to render a page with a specific input (“render single.html
with the latest Page as input”) in index.html
?