|
| 1 | +{{if .PageIsUserProfile}} |
| 2 | + <meta property="og:title" content="{{.ContextUser.DisplayName}}"> |
| 3 | + <meta property="og:type" content="profile"> |
| 4 | + <meta property="og:image" content="{{.ContextUser.AvatarLink ctx}}"> |
| 5 | + <meta property="og:url" content="{{.ContextUser.HTMLURL}}"> |
| 6 | + {{if .ContextUser.Description}} |
| 7 | + <meta property="og:description" content="{{.ContextUser.Description}}"> |
| 8 | + {{end}} |
| 9 | +{{else if .Repository}} |
| 10 | + {{if .Issue}} |
| 11 | + <meta property="og:title" content="{{.Issue.Title}}"> |
| 12 | + <meta property="og:url" content="{{.Issue.HTMLURL}}"> |
| 13 | + {{if .Issue.Content}} |
| 14 | + <meta property="og:description" content="{{.Issue.Content}}"> |
| 15 | + {{end}} |
| 16 | + {{else if or .PageIsDiff .IsViewFile}} |
| 17 | + <meta property="og:title" content="{{.Title}}"> |
| 18 | + <meta property="og:url" content="{{AppUrl}}{{.Link}}"> |
| 19 | + {{if and .PageIsDiff (IsMultilineCommitMessage .Commit.Message)}} |
| 20 | + <meta property="og:description" content="{{RenderCommitBody $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}"> |
| 21 | + {{end}} |
| 22 | + {{else}} |
| 23 | + <meta property="og:title" content="{{.Repository.Name}}"> |
| 24 | + <meta property="og:url" content="{{.Repository.HTMLURL}}"> |
| 25 | + {{if .Repository.Description}} |
| 26 | + <meta property="og:description" content="{{.Repository.Description}}"> |
| 27 | + {{end}} |
| 28 | + {{end}} |
| 29 | + <meta property="og:type" content="object"> |
| 30 | + {{if (.Repository.AvatarLink ctx)}} |
| 31 | + <meta property="og:image" content="{{.Repository.AvatarLink ctx}}"> |
| 32 | + {{else}} |
| 33 | + <meta property="og:image" content="{{.Repository.Owner.AvatarLink ctx}}"> |
| 34 | + {{end}} |
| 35 | +{{else}} |
| 36 | + <meta property="og:title" content="{{AppName}}"> |
| 37 | + <meta property="og:type" content="website"> |
| 38 | + <meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png"> |
| 39 | + <meta property="og:url" content="{{AppUrl}}"> |
| 40 | + <meta property="og:description" content="{{MetaDescription}}"> |
| 41 | +{{end}} |
| 42 | +<meta property="og:site_name" content="{{AppName}}"> |
0 commit comments