diff --git a/appview/pulls/opengraph.go b/appview/pulls/opengraph.go --- a/appview/pulls/opengraph.go +++ b/appview/pulls/opengraph.go @@ -214,34 +214,22 @@ } filesTextWidth := len(filesText) * 20 - currentX += filesTextWidth + 40 + currentX += filesTextWidth // Draw additions (green +) greenColor := color.RGBA{34, 139, 34, 255} - err = statusStatsArea.DrawSVGIcon("static/icons/plus.svg", currentX, statsY+iconBaselineOffset-iconSize/2+5, iconSize, greenColor) - if err != nil { - log.Printf("failed to draw plus icon: %v", err) - } - - currentX += iconSize + 15 - additionsText := fmt.Sprintf("%d", diffStats.Insertions) + additionsText := fmt.Sprintf("+%d", diffStats.Insertions) err = statusStatsArea.DrawTextAt(additionsText, currentX, statsY+iconBaselineOffset, greenColor, textSize, ogcard.Middle, ogcard.Left) if err != nil { log.Printf("failed to draw additions text: %v", err) } additionsTextWidth := len(additionsText) * 20 - currentX += additionsTextWidth + 15 + currentX += additionsTextWidth + 30 // Draw deletions (red -) right next to additions redColor := color.RGBA{220, 20, 60, 255} - err = statusStatsArea.DrawSVGIcon("static/icons/minus.svg", currentX, statsY+iconBaselineOffset-iconSize/2+5, iconSize, redColor) - if err != nil { - log.Printf("failed to draw minus icon: %v", err) - } - - currentX += iconSize + 15 - deletionsText := fmt.Sprintf("%d", diffStats.Deletions) + deletionsText := fmt.Sprintf("-%d", diffStats.Deletions) err = statusStatsArea.DrawTextAt(deletionsText, currentX, statsY+iconBaselineOffset, redColor, textSize, ogcard.Middle, ogcard.Left) if err != nil { log.Printf("failed to draw deletions text: %v", err) diff --git a/appview/pages/templates/repo/fragments/og.html b/appview/pages/templates/repo/fragments/og.html --- a/appview/pages/templates/repo/fragments/og.html +++ b/appview/pages/templates/repo/fragments/og.html @@ -11,7 +11,7 @@ - + diff --git a/appview/pages/templates/repo/issues/issue.html b/appview/pages/templates/repo/issues/issue.html --- a/appview/pages/templates/repo/issues/issue.html +++ b/appview/pages/templates/repo/issues/issue.html @@ -2,10 +2,7 @@ {{ define "extrameta" }} - {{ $title := printf "%s · issue #%d · %s" .Issue.Title .Issue.IssueId .RepoInfo.FullName }} - {{ $url := printf "https://tangled.org/%s/issues/%d" .RepoInfo.FullName .Issue.IssueId }} - - {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} + {{ template "repo/issues/fragments/og" (dict "RepoInfo" .RepoInfo "Issue" .Issue) }} {{ end }} {{ define "repoContentLayout" }} diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -3,10 +3,7 @@ {{ end }} {{ define "extrameta" }} - {{ $title := printf "%s · pull #%d · %s" .Pull.Title .Pull.PullId .RepoInfo.FullName }} - {{ $url := printf "https://tangled.org/%s/pulls/%d" .RepoInfo.FullName .Pull.PullId }} - - {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} + {{ template "repo/pulls/fragments/og" (dict "RepoInfo" .RepoInfo "Pull" .Pull) }} {{ end }} {{ define "repoContentLayout" }} diff --git a/appview/pages/templates/repo/issues/fragments/og.html b/appview/pages/templates/repo/issues/fragments/og.html --- a/appview/pages/templates/repo/issues/fragments/og.html +++ b/appview/pages/templates/repo/issues/fragments/og.html @@ -1,4 +1,4 @@ -{{ define "issues/fragments/og" }} +{{ define "repo/issues/fragments/og" }} {{ $title := printf "%s #%d" .Issue.Title .Issue.IssueId }} {{ $description := or .Issue.Body .RepoInfo.Description }} {{ $url := printf "https://tangled.org/%s/issues/%d" .RepoInfo.FullName .Issue.IssueId }} diff --git a/appview/pages/templates/repo/pulls/fragments/og.html b/appview/pages/templates/repo/pulls/fragments/og.html --- a/appview/pages/templates/repo/pulls/fragments/og.html +++ b/appview/pages/templates/repo/pulls/fragments/og.html @@ -1,4 +1,4 @@ -{{ define "pulls/fragments/og" }} +{{ define "repo/pulls/fragments/og" }} {{ $title := printf "%s #%d" .Pull.Title .Pull.PullId }} {{ $description := or .Pull.Body .RepoInfo.Description }} {{ $url := printf "https://tangled.org/%s/pulls/%d" .RepoInfo.FullName .Pull.PullId }} @@ -16,4 +16,4 @@ -{{ end }} \ No newline at end of file +{{ end }}