Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ params:
displayUpdatedDate: true
dateFormat: "January 2, 2006"

# Display the author name of the last modified date
displayUpdatedAuthor: true

# Search
# flexsearch is enabled by default
search:
Expand Down
10 changes: 9 additions & 1 deletion layouts/_partials/components/last-updated.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{{- $lastUpdated := (T "lastUpdated") | default "Last updated on" -}}
{{- $page := . -}}

{{- if site.Params.displayUpdatedDate -}}
{{- with .Lastmod -}}
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }}
<div class="hx:mt-12 hx:mb-8 hx:block hx:text-xs hx:text-gray-500 hx:ltr:text-right hx:rtl:text-left hx:dark:text-gray-400">{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
<div class="hx:mt-12 hx:mb-8 hx:block hx:text-xs hx:text-gray-500 hx:ltr:text-right hx:rtl:text-left hx:dark:text-gray-400">
{{ $lastUpdated }} <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time>
{{- if site.Params.displayUpdatedAuthor -}}
{{- with $page.GitInfo -}}
{{ print " • " .AuthorName | safeHTML }}
{{- end -}}
{{- end -}}
</div>
{{- else -}}
<div class="hx:mt-16"></div>
{{- end -}}
Expand Down