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
1 change: 1 addition & 0 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ defaultContentLanguage = 'en'
editPage = true # enable 'Edit this page' feature - default false
lastMod = true # enable 'Last modified' date on pages - default false
lastModRelative = true # format 'Last modified' time as relative - default true
useLastmodTime = false # use lastmod time for content or fallback to git info - default false

sidebarIcons = true # enable sidebar icons? default false
breadcrumbs = true # default is true
Expand Down
26 changes: 18 additions & 8 deletions layouts/partials/docs/gitinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,35 @@
{{ if .Site.Params.docs.editPage | default false -}}
<div id="edit-this-page" class="mt-1">
<a href="{{ $editPageURL }}" alt="{{ .Title }}" rel="noopener noreferrer" target="_blank">
<!-- <span class="material-icons size-20 align-text-bottom text-primary">edit</span> -->
<span class="me-1 align-text-bottom">
{{ with resources.Get $iconPath }}
{{ .Content | safeHTML }}
{{ end }}
</span>
Edit this page
<!-- <span class="material-icons size-20 align-text-bottom text-primary">open_in_new</span> -->
</a>
</div>
{{ end }}
{{ if .Site.Params.docs.lastMod | default false -}}
<div id="last-modified" class="mt-1">
<p class="mb-0 fw-semibold">Last updated <span
{{ if .Site.Params.docs.lastModRelative | default true -}}id="relativetime"{{ else }}{{ end }}
data-authdate="{{ dateFormat "2006-01-02T15:04:05Z0700" .GitInfo.AuthorDate }}"
{{ if .Site.Params.docs.lastModRelative | default true -}}title="{{ dateFormat "02 Jan 2006, 15:04 MST" .GitInfo.AuthorDate }}"{{ else }}{{ end }}>
{{ dateFormat "02 Jan 2006, 15:04 MST" .GitInfo.AuthorDate }}
</span>. <span class="material-icons size-20 align-text-bottom opacity-75">history</span>
<p class="mb-0 fw-semibold">Last updated
<span
{{- if .Site.Params.docs.lastModRelative | default true }} id="relativetime"{{ end }}
{{- if .Params.lastmod }}
data-authdate="{{ dateFormat "2006-01-02T15:04:05Z0700" .Params.lastmod }}"
{{- else if and (.Site.Params.docs.useLastmodTime | default false) (.Lastmod) }}
data-authdate="{{ dateFormat "2006-01-02T15:04:05Z0700" .Lastmod }}"
{{- else }}
data-authdate="{{ dateFormat "2006-01-02T15:04:05Z0700" .GitInfo.AuthorDate }}"
{{- end }}>
{{- if .Params.lastmod -}}
{{ dateFormat "02 Jan 2006, 15:04 MST" .Params.lastmod }}
{{- else if and (.Site.Params.docs.useLastmodTime | default false) (.Lastmod) -}}
{{ dateFormat "02 Jan 2006, 15:04 MST" .Lastmod }}
{{- else -}}
{{ dateFormat "02 Jan 2006, 15:04 MST" .GitInfo.AuthorDate }}
{{- end -}}
</span>. <span class="material-icons size-20 align-text-bottom opacity-75">history</span>
</p>
</div>
{{ end }}
Expand Down