Added a landing page
-
replaced the entirety of the contents in the theme’s /layouts/index.html with the following:
<!DOCTYPE html> <html lang="{{ .Site.LanguageCode }}"> {{- partial "head" . -}} <body> {{- block "main" . }} <main aria-role="main" style="padding-top: 15em; text-align: center"> <header class="homepage-header"> <h1>{{ .Site.Title }}</h1> {{ with .Params.subtitle }} <span class="subtitle">{{.}}</span> {{ end }} </header> <div class="homepage-content"> <!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md --> <h4>{{ .Title }}</h4> {{.Content}} </div> </main> {{- end }} </body> </html>
This was made copying elements from theme’s layouts/_default/baseof.html and hugo docs’s homepage template.
Then I wrote whatever I want in /content/_index.md to display in the landing page.
Consequently, the header gets affected. To make it link to the posts feed instead of the landing page:
-
in the theme’s layouts/partials/header.html, I replaced all instances of
{{ .Site.BaseURL }}
with/posts