From 8817c3ca119d07abef6871d2bd3d967e92e9bf20 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Tue, 17 Feb 2026 09:33:43 +0200 Subject: [PATCH] appview/pages: improve commit page title Should look better on opengraph cards. Signed-off-by: Anirudh Oppiliappan --- appview/pages/templates/repo/commit.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index cd1128aa..964d4e93 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -1,7 +1,11 @@ -{{ define "title" }} commit {{ .Diff.Commit.This }} · {{ .RepoInfo.FullName }} {{ end }} +{{ define "title" }} + {{ $messageParts := splitN .Diff.Commit.Message "\n\n" 2 }} + {{ index $messageParts 0 }} · {{ .RepoInfo.FullName }}@{{ slice .Diff.Commit.This 0 7 }} +{{ end }} {{ define "extrameta" }} - {{ $title := printf "commit %s · %s" .Diff.Commit.This .RepoInfo.FullName }} + {{ $messageParts := splitN .Diff.Commit.Message "\n\n" 2 }} + {{ $title := printf "%s · %s@%s" (index $messageParts 0) .RepoInfo.FullName (slice .Diff.Commit.This 0 7) }} {{ $url := printf "https://tangled.org/%s/commit/%s" .RepoInfo.FullName .Diff.Commit.This }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} -- 2.51.2