Allow users to re-define post section name (#172)
* Allow users to re-define post section name
* Added example to config.toml
Co-authored-by: Alexander Bilz <mail@alexbilz.com>
| | |
| | | ``` |
| | | Put any content into the `_index.md` file located in the content directory. If you want, you can also have some static text and the posts below. In such case, simply keep the `mainSections = ["post"]` and put any static content in the `_index.md`. |
| | | |
| | | ### Rename post section |
| | | If you want to have a different post section identifier, such as `/blog`, you can specify the section name using `postSectionName`: |
| | | |
| | | ```toml |
| | | [params] |
| | | postSectionName = "blog" |
| | | ``` |
| | | |
| | | If the parameter is not set, it will default to `post`. |
| | | |
| | | ### Show full post content on the home page |
| | | If you prefer the full content of your posts to appear on the home page rather than a summary of each post, then set the parameter `fullPostContent` to `true`. |
| | | ```toml |
| | |
| | | # CommentoURL = "https://commento.example.com/js/commento.js" |
| | | # Read More links for truncated summaries |
| | | # readMore = true |
| | | |
| | | # postSectionName = "blog" |
| | | |
| | | [params.simpleAnalytics] |
| | | # enable = true |
| | |
| | | {{ end }} |
| | | <div class="post-title"> |
| | | <h3>{{ .Title }}</h3> |
| | | {{ if eq .Type "post"}} |
| | | {{ if or (eq .Type "post") (eq .Type .Site.Params.postSectionName) }} |
| | | <div class="info"> |
| | | <em class="fas fa-calendar-day"></em> |
| | | <span class="date">{{ if isset .Site.Params "singledateformat" }} |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | {{ if and (eq .Type "post") (ne .Page.Params.disableComments true) }} |
| | | {{ if and (or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (ne .Page.Params.disableComments true) }} |
| | | {{- if .Site.DisqusShortname -}} |
| | | <div id="fb_comments_container"> |
| | | <h2>{{ i18n "comments" }}</h2> |