{{ define "title" }} commit {{ .Diff.Commit.This }} {{ end }} {{ define "repoContent" }} {{ $repo := .RepoInfo.FullName }} {{ $commit := .Diff.Commit }} {{ $stat := .Diff.Stat }} {{ $diff := .Diff.Diff }}
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
{{ index $messageParts 0 }} {{ if gt (len $messageParts) 1 }}

{{ nl2br (unwrapText (index $messageParts 1)) }}

{{ end }}

{{ $commit.Author.Name }} {{ timeFmt $commit.Author.When }} {{ $stat.FilesChanged }} files (+{{ $stat.Insertions }}, -{{ $stat.Deletions }}) {{ slice $commit.This 0 8 }} {{ if $commit.Parent }} {{ slice $commit.Parent 0 8 }} {{ end }}


jump to {{ range $diff }} {{ end }}
{{end}} {{ define "repoAfter" }} {{ $repo := .RepoInfo.FullName }} {{ $commit := .Diff.Commit }} {{ $stat := .Diff.Stat }} {{ $diff := .Diff.Diff }} {{ $this := $commit.This }} {{ $parent := $commit.Parent }} {{ $last := sub (len $diff) 1 }} {{ range $idx, $hunk := $diff }} {{ with $hunk }}
{{ if .IsNew }} A {{ end }} {{ if .IsDelete }} D {{ end }} {{ if not (or .IsNew .IsDelete) }} M {{ end }} {{ .Name.New }}
{{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 rounded" }}
{{ if gt $idx 0 }} {{ $prev := index $diff (sub $idx 1) }} {{ end }} {{ if lt $idx $last }} {{ $next := index $diff (add $idx 1) }} {{ end }}
{{ if .IsBinary }}

Not showing binary file.

{{ else }}
            {{- range .TextFragments -}}
              
{{ .Header }}
{{- range .Lines -}} {{- if eq .Op.String "+" -}}
{{ .Op.String }}{{ .Line }}
{{- end -}} {{- if eq .Op.String "-" -}}
{{ .Op.String }}{{ .Line }}
{{- end -}} {{- if eq .Op.String " " -}}
{{ .Op.String }}{{ .Line }}
{{- end -}} {{- end -}} {{- end -}}
{{- end -}}
{{ end }} {{ end }} {{end}}