Browse Source

Merge 4bc330944a into b4f40ded77

pull/291/merge
Lars Kruse 4 years ago
parent
commit
b206f6da76
No account linked to committer's email address
3 changed files with 14 additions and 2 deletions
  1. 12
    0
      README.md
  2. 1
    1
      layouts/_default/single.html
  3. 1
    1
      layouts/post/summary.html

+ 12
- 0
README.md View File

``` ```




### Localize date format

Dates of blog posts and single pages are rendered with the default date format commonly used in the USA and Canada. It is possible to specify a different format.

```
[params]
date_format = "2. January 2006"
```

See hugo's documentation of the [`dateFormat` function](https://gohugo.io/functions/dateformat/) for more details.


### Nearly finished ### Nearly finished


In order to see your site in action, run Hugo's built-in local server. In order to see your site in action, run Hugo's built-in local server.

+ 1
- 1
layouts/_default/single.html View File

{{ end }} {{ end }}
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> <time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}}
{{- .Date.Format (default "January 2, 2006" .Site.Params.date_format) -}}
</time> </time>


{{/* {{/*

+ 1
- 1
layouts/post/summary.html View File

<div class="mb3 pa4 mid-gray overflow-hidden"> <div class="mb3 pa4 mid-gray overflow-hidden">
{{ if .Date }} {{ if .Date }}
<div class="f6"> <div class="f6">
{{ .Date.Format "January 2, 2006" }}
{{ .Date.Format (default "January 2, 2006" .Site.Params.date_format) }}
</div> </div>
{{ end }} {{ end }}
<h1 class="f3 near-black"> <h1 class="f3 near-black">

Loading…
Cancel
Save