Skip to content

Commit 317732d

Browse files
authored
feat: Display Git lastmod information at the file level (#1493)
Signed-off-by: rogerogers <[email protected]>
1 parent 9774c27 commit 317732d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

assets/scss/_pageinfo.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@
1616
}
1717

1818
}
19+
20+
.td-page-meta {
21+
&__lastmod {
22+
@extend .text-muted;
23+
@extend .border-top;
24+
margin-top: map-get($spacers, 5) !important;
25+
padding-top: map-get($spacers, 3) !important;
26+
}
27+
}
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
<div class="text-muted mt-5 pt-3 border-top">
2-
{{ if and (.GitInfo) (.Site.Params.github_repo) }}
3-
{{ T "post_last_mod"}}
4-
{{ .Lastmod.Format .Site.Params.time_format_default }}
5-
{{ with .GitInfo }}: <a href="{{ $.Site.Params.github_repo }}/commit/{{ .Hash }}">{{ .Subject }} ({{ .AbbreviatedHash }})</a>{{ end }}
6-
{{ end }}
1+
{{ if and .GitInfo .Site.Params.github_repo -}}
2+
<div class="td-page-meta__lastmod">
3+
{{ T "post_last_mod" }} {{ .Lastmod.Format .Site.Params.time_format_default -}}
4+
{{ with .GitInfo }}: {{/* Trim WS */ -}}
5+
<a data-proofer-ignore href="{{ $.Site.Params.github_repo }}/commit/{{ .Hash }}">
6+
{{- .Subject }} ({{ .AbbreviatedHash }}) {{- /* Trim WS */ -}}
7+
</a>
8+
{{- end }}
79
</div>
10+
{{ end -}}

0 commit comments

Comments
 (0)