-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable timestamping for posts (#494)
* Add configurable timestamping * Add attribution for configurable timestamping * Add new post timestamp options to example hugo.toml * All date formats are now set by single config option in site or page config * Add post timestamp explainer and examples to example config file * Add configurable timestamping value to frontmatter archetype * Explain possible timezone rendering issue with new time formatting * Fix bug concerning time/date tokens * Convert datestamps to work with a partial * Fix issue with lastmod being equal to date * Add Updated prefix functionality
- Loading branch information
1 parent
08ec931
commit c779a70
Showing
8 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- $date := .Date -}} | ||
{{- with .Params.dateFormat -}} | ||
{{- $date | time.Format . -}} | ||
{{- else -}} | ||
{{- with .Site.Params.dateFormat -}} | ||
{{- $date | time.Format . -}} | ||
{{- else -}} | ||
{{- $date | time.Format "2006-01-02" -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- $date := .Lastmod -}} | ||
{{- with .Params.dateFormat -}} | ||
{{- $date | time.Format . -}} | ||
{{- else -}} | ||
{{- with .Site.Params.dateFormat -}} | ||
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format . -}}] | ||
{{- else -}} | ||
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format "2006-01-02" -}}] | ||
{{- end -}} | ||
{{- end -}} |