diff --git a/README.md b/README.md index 582fd65..c6719e5 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,9 @@ paginate = 5 # With this option you don't have to put the `cover` param in a front-matter. autoCover = true + # Provide a string as a date format. By default, 2006-01-02. See https://pkg.go.dev/github.com/vigneshuvi/GoDateFormat "Constants and Placeholders" for more information. + dateFormat = "01-02-2006" + # set post to show the last updated # If you use git, you can set `enableGitInfo` to `true` and then post will automatically get the last updated showLastUpdated = false diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a06270a..25fa46c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -9,6 +9,7 @@ paginate = 5 showMenuItems = 2 fullWidthTheme = false centerTheme = false + dateFormat = "2006-01-02" [languages] [languages.en] diff --git a/layouts/_default/index.html b/layouts/_default/index.html index 1cab615..80eee32 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -21,7 +21,7 @@
- {{ .Date.Format "2006-01-02" }} + {{ .Date.Format $.Site.Params.dateFormat }} {{ with .Params.Author }} :: {{ . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 02f69b4..85733a1 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -12,7 +12,7 @@
{{ with .Params.Author }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3d375ad..81637d7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,9 +5,9 @@