diff --git a/gitea/custom/templates/base/head_opengraph.tmpl b/gitea/custom/templates/base/head_opengraph.tmpl new file mode 100644 index 0000000..5f41880 --- /dev/null +++ b/gitea/custom/templates/base/head_opengraph.tmpl @@ -0,0 +1,51 @@ +{{- /* og:description - a one to two sentence description of your object, maybe it only needs at most 300 bytes */ -}} +{{if .PageIsUserProfile}} + + + + + {{if .ContextUser.Description}} + + {{end}} +{{else if .Repository}} + {{if .Issue}} + + + {{if .Issue.Content}} + + {{end}} + {{else if or .PageIsDiff .IsViewFile}} + + + {{if and .PageIsDiff .Commit}} + {{- $commitMessageBody := .Commit.MessageBody -}} + {{- if $commitMessageBody -}} + + {{- end -}} + {{end}} + {{else}} + + + {{if .Repository.Description}} + + {{end}} + {{end}} + + {{if (.Repository.AvatarLink ctx)}} + + {{else}} + + {{end}} +{{else}} + {{/* Teahub: the 1200x630 card at an absolute URL (WhatsApp needs one), its size, and the large-card layout. */}} + + + + + + + + + +{{end}} +