Add Option for Main Section Heading (#216)
Added an option to define a section heading for the posts on the frontpage through the _index.md file.
Co-authored-by: Alexander Bilz <mail@alexbilz.com>
| | |
| | | mainSections = ["post", "docs"] |
| | | ``` |
| | | |
| | | ### _index.md and post section header |
| | | You can place custom content, by creating `_index.md` markdown file within the content directory. An example can be found [here](https://github.com/lxndrblz/anatole/blob/exampleSite/content/english/_index.md). Uncomment the section as needed. This file `_index.md` also has a parameter called `mainSectionsTitle`, which lets you specify a header for the posts on the main page. This header will be styled and placed always after the content of the `_index.md` it self. |
| | | |
| | | ### Robots.txt |
| | | |
| | | If you want Hugo to generate a robots.txt, you will have to set the `enableRobotsTXT` in the `config.toml` to `true`. By default, a robots.txt, which allows search engine crawlers to access to any page, will be generated. It will look like this: |
| | |
| | | +++ |
| | | |
| | | <!-- |
| | | This file is left intentionally empty by default to be backward compatible with initial theme setup. |
| | | This file is left intentionally empty by default to be backwards compatible with the 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: |
| | |
| | | Don't forget to check the README.md file! |
| | | ``` |
| | | |
| | | Remember that you can also specify a section header for the posts below by configuring the `mainSectionsTitle` parameter in the front matter of this file. |
| | | --> |
| | |
| | | +++ |
| | | |
| | | <!-- |
| | | This file is left intentionally empty by default to be backward compatible with initial theme setup. |
| | | This file is left intentionally empty by default to be backwards compatible with the 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: |
| | |
| | | Don't forget to check the README.md file! |
| | | ``` |
| | | |
| | | Remember that you can also specify a section header for the posts below by configuring the `mainSectionsTitle` parameter in the front matter of this file. |
| | | --> |
| | |
| | | --> |
| | | </div> |
| | | |
| | | {{ if .Params.mainSectionsTitle }} |
| | | <div class="post {{ with .Site.Params.doNotLoadAnimations }} . {{ else }} animated fadeInDown {{ end }}"> |
| | | <div class="post-title post-content"> |
| | | <h2>{{ .Params.mainSectionsTitle }}</h2> |
| | | </div> |
| | | </div> |
| | | {{ end }} |
| | | |
| | | {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} |
| | | {{ range $paginator.Pages }} |
| | | |