Skip to content

Commit

Permalink
Use dateFormat option instead of postDateFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
Laborratte5 committed Sep 7, 2024
1 parent bcb4d7b commit 7a4fcdd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ theme = "hugo-blog-awesome"
# When building for production it will be minified.
# The file `custom.js` is loaded on each page (before body tag ends).
dateFormat = "" # date format used to show dates on various pages. If nothing is specified, then "2 Jan 2006" format is used.
postDateFormat = "" # date format used to show the published date at the beginning of each post. If nothing is specified, then ":date_medium" format is used.
# See https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference for available date formats.
rssFeedDescription = "summary" # available options: 1) summary 2) full
# summary - includes a short summary of the blog post in the RSS feed. Generated using Hugo .Summary .
Expand Down Expand Up @@ -155,7 +154,6 @@ theme = "hugo-blog-awesome"
# When building for production it will be minified.
# The file `custom.js` is loaded on each page (before body tag ends).
dateFormat = "2 January 2006" # default date format used on various pages
postDateFormat = "" # date format used to show the published date at the beginning of each post. If nothing is specified, then ":date_medium" format is used.
# See https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference for available date formats.
rssFeedDescription = "summary" # available options: 1) summary 2) full
# summary - includes a short summary of the blog post in the RSS feed. Generated using Hugo .Summary .
Expand Down Expand Up @@ -221,7 +219,6 @@ theme = "hugo-blog-awesome"
# When building for production it will be minified.
# The file `custom.js` is loaded on each page (before body tag ends).
dateFormat = "" # date format used to show dates on various pages. If nothing is specified, then "2 Jan 2006" format is used.
postDateFormat = "" # date format used to show the published date at the beginning of each post. If nothing is specified, then ":date_medium" format is used.
# See https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference for available date formats.
rssFeedDescription = "summary" # available options: 1) summary 2) full
# summary - includes a short summary of the blog post in the RSS feed. Generated using Hugo .Summary .
Expand Down Expand Up @@ -287,7 +284,6 @@ theme = "hugo-blog-awesome"
# When building for production it will be minified.
# The file `custom.js` is loaded on each page (before body tag ends).
dateFormat = "" # date format used to show dates on various pages. If nothing is specified, then "2 Jan 2006" format is used.
postDateFormat = "" # date format used to show the published date at the beginning of each post. If nothing is specified, then ":date_medium" format is used.
# See https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference for available date formats.
rssFeedDescription = "summary" # available options: 1) summary 2) full
# summary - includes a short summary of the blog post in the RSS feed. Generated using Hugo .Summary .
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<article>
<header class="header">
<h1 class="header-title">{{ .Title }}</h1>
{{ $configDateFormat := .Site.Params.postDateFormat | default ":date_medium" }}
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<div class="post-meta">
Expand Down

0 comments on commit 7a4fcdd

Please sign in to comment.