Merge pull request #107 from ivangjxyz/date-improvements
Date format parametrization
| | |
| | | doNotLoadAnimations = true # Animations are loaded by default |
| | | ``` |
| | | |
| | | ### Control the date Format |
| | | You can change the default date formating for the `list.html`, the `single.html` and the `index.html`. Simply configure the matching parameters. |
| | | ```toml |
| | | [params] |
| | | singleDateFormat = "Mon, Jan 2, 2006" |
| | | indexDateFormat = "Mon, Jan 2, 2006" |
| | | listDateFormat = "Jan 2" |
| | | ``` |
| | | |
| | | ### Have a static page as a home page |
| | | If you prefer having a static page as your home page rather than a listing of the latest posts, then make sure you leave the `mainSections` parameter blank: |
| | | ```toml |
| | |
| | | display: block; |
| | | flex-grow: 0; |
| | | flex-shrink: 0; |
| | | display: block; |
| | | line-height: 2.5; |
| | | padding: .5rem .75rem; |
| | | position: relative; |
| | |
| | | border: 1px solid var(--form-button-hover-border-color); |
| | | } |
| | | |
| | | /* (CONTACT) FORM END */ |
| | | /* (CONTACT) FORM END */ |
| | |
| | | #contactFormAction = "https://formspree.io/f/your-form-hash-here" |
| | | # Google Site Verify |
| | | #googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| | | # indexDateFormat = "Mon, Jan 2, 2006" |
| | | # listDateFormat = "Jan 2" |
| | | # singleDateFormat = "Mon, Jan 2, 2006" |
| | | |
| | | [params.simpleAnalytics] |
| | | # enable = true |
| | |
| | | name = "Contact" |
| | | weight = 400 |
| | | identifier = "contact" |
| | | url = "/contact/" |
| | | url = "/contact/" |
| | |
| | | <ul class="listing"> |
| | | <div class="listing-item"> |
| | | <div class="listing-post"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a> |
| | | <div class="post-time"><span class="date">{{.Date.Format "Jan 2" }}</span></div> |
| | | <div class="post-time"><span class="date">{{ if isset .Site.Params "listdateformat" }} |
| | | {{ .Date.Format .Site.Params.listDateFormat }} |
| | | {{ else }} {{.Date.Format "Jan 2"}} |
| | | {{ end }}</span></div> |
| | | </div> |
| | | </div> |
| | | </ul> |
| | |
| | | {{ if eq .Type "post"}} |
| | | <div class="info"> |
| | | <em class="fas fa-calendar-day"></em> |
| | | <span class="date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> |
| | | <span class="date">{{ if isset .Site.Params "singledateformat" }} |
| | | {{ .Date.Format .Site.Params.singleDateFormat }} |
| | | {{ else }} {{.Date.Format "Mon, Jan 2, 2006"}} |
| | | {{ end }}</span> |
| | | <em class="fas fa-stopwatch"></em> |
| | | <span class="reading-time">{{ i18n "reading_time" .ReadingTime }}</span> |
| | | </div> |
| | |
| | | <div class="post-footer"> |
| | | <div class="meta"> |
| | | <div class="info"><em class="fas fa-calendar-day"></em><span |
| | | class="date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> |
| | | class="date">{{ if isset .Site.Params "indexdateformat" }} |
| | | {{ .Date.Format .Site.Params.indexDateFormat }} |
| | | {{ else }} {{.Date.Format "Mon, Jan 2, 2006"}} |
| | | {{ end }}</span> |
| | | {{ with .Params.tags }} |
| | | {{- range $index, $el := . -}} |
| | | <a class="tag" |