Make it possible to add (optional) content to Home page
| | |
| | | +++ |
| | | author = "Hugo Authors" |
| | | +++ |
| | | |
| | | <!-- |
| | | This file is left intentionally empty by default to be backward compatible with initial theme setup. |
| | | |
| | | Although the theme has advanced a little bit and it now allows to specify the content on the main page (even if the list of posts/articles is not intended). |
| | | This can be: |
| | | - with the list of posts/articles (default: `mainSections = ["post"]) or |
| | | - without the list of posts/articles (by setting `mainSections = [""]`) |
| | | |
| | | Markdown supported, ie: |
| | | |
| | | ``` |
| | | # Welcome |
| | | |
| | | - Hugo :rocket: |
| | | - Hugo theme :rocket: |
| | | |
| | | Don't forget to check the README.md file! |
| | | ``` |
| | | |
| | | --> |
| | |
| | | {{ define "main" }} |
| | | |
| | | <div class="post {{ with .Site.Params.doNotLoadAnimations }} . {{ else }} animated fadeInDown {{ end }}"> |
| | | <!-- (Optional) Home |
| | | -- on top of `mainSections` content (aka posts) ; |
| | | -- as declared in content/_index.md |
| | | |
| | | One can set `mainSections = [""]` and have the content/_index.md specified here |
| | | --> |
| | | {{ .Content }} |
| | | </div> |
| | | |
| | | {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} |
| | | {{ range $paginator.Pages }} |
| | | |
| | | <div class="post {{ with .Site.Params.doNotLoadAnimations }} . {{ else }} animated fadeInDown {{ end }}"> |
| | | <div class="post-title"> |
| | | <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a> |