Skip to content

Commit

Permalink
Switch to 'repo.url' for last commit link and deprecate 'github_url'
Browse files Browse the repository at this point in the history
  • Loading branch information
smainz committed May 10, 2024
1 parent 439b9ac commit 04f235d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion layouts/partials/page-meta-lastmod.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ if and .GitInfo .Site.Params.github_repo -}}
{{ if and .GitInfo .Site.Params.github_repo -}}
{{ warnf "Warning: use of `github_repo` is deprecated, use `repo.url` instead " -}}
<div class="td-page-meta__lastmod">
{{ T "post_last_mod" }} {{ .Lastmod.Format .Site.Params.time_format_default -}}
{{ with .GitInfo }}: {{/* Trim WS */ -}}
Expand All @@ -8,3 +9,16 @@
{{- end }}
</div>
{{ end -}}

{{/* Looks like all repo types have the same frmat for the commit link */}}
{{ if and .GitInfo .Site.Params.repo.type -}}
<div class="td-page-meta__lastmod">
{{ T "post_last_mod" }} {{ .Lastmod.Format .Site.Params.time_format_default -}}
{{ with .GitInfo }}: {{/* Trim WS */ -}}
<a href="{{ $.Site.Params.repo.url }}/commit/{{ .Hash }}">
{{- .Subject }} ({{ .AbbreviatedHash }}) {{- /* Trim WS */ -}}
</a>
{{- end }}
</div>
{{ end -}}

0 comments on commit 04f235d

Please sign in to comment.