2023-09-02 21:43:29 -04:00
|
|
|
{{- /* og:description - a one to two sentence description of your object, maybe it only needs at most 300 bytes */ -}}
|
2023-09-01 12:59:24 -04:00
|
|
|
{{if .PageIsUserProfile}}
|
|
|
|
<meta property="og:title" content="{{.ContextUser.DisplayName}}">
|
|
|
|
<meta property="og:type" content="profile">
|
|
|
|
<meta property="og:image" content="{{.ContextUser.AvatarLink ctx}}">
|
|
|
|
<meta property="og:url" content="{{.ContextUser.HTMLURL}}">
|
|
|
|
{{if .ContextUser.Description}}
|
2023-09-02 21:43:29 -04:00
|
|
|
<meta property="og:description" content="{{StringUtils.EllipsisString .ContextUser.Description 300}}">
|
2023-09-01 12:59:24 -04:00
|
|
|
{{end}}
|
|
|
|
{{else if .Repository}}
|
|
|
|
{{if .Issue}}
|
|
|
|
<meta property="og:title" content="{{.Issue.Title}}">
|
|
|
|
<meta property="og:url" content="{{.Issue.HTMLURL}}">
|
|
|
|
{{if .Issue.Content}}
|
2023-09-02 21:43:29 -04:00
|
|
|
<meta property="og:description" content="{{StringUtils.EllipsisString .Issue.Content 300}}">
|
2023-09-01 12:59:24 -04:00
|
|
|
{{end}}
|
|
|
|
{{else if or .PageIsDiff .IsViewFile}}
|
|
|
|
<meta property="og:title" content="{{.Title}}">
|
|
|
|
<meta property="og:url" content="{{AppUrl}}{{.Link}}">
|
2024-01-07 05:20:22 -05:00
|
|
|
{{if and .PageIsDiff .Commit}}
|
2023-09-02 21:43:29 -04:00
|
|
|
{{- $commitMessageParts := StringUtils.Cut .Commit.Message "\n" -}}
|
|
|
|
{{- $commitMessageBody := index $commitMessageParts 1 -}}
|
|
|
|
{{- if $commitMessageBody -}}
|
|
|
|
<meta property="og:description" content="{{StringUtils.EllipsisString $commitMessageBody 300}}">
|
|
|
|
{{- end -}}
|
2023-09-01 12:59:24 -04:00
|
|
|
{{end}}
|
2024-07-10 14:29:35 -04:00
|
|
|
{{else if .Pages}}
|
|
|
|
<meta property="og:title" content="{{.Title}}">
|
|
|
|
<meta property="og:url" content="{{AppUrl}}{{.Link}}">
|
|
|
|
{{if .Repository.Description}}
|
|
|
|
<meta property="og:description" content="{{StringUtils.EllipsisString .Repository.Description 300}}">
|
|
|
|
{{end}}
|
2023-09-01 12:59:24 -04:00
|
|
|
{{else}}
|
|
|
|
<meta property="og:title" content="{{.Repository.Name}}">
|
|
|
|
<meta property="og:url" content="{{.Repository.HTMLURL}}">
|
|
|
|
{{if .Repository.Description}}
|
2023-09-02 21:43:29 -04:00
|
|
|
<meta property="og:description" content="{{StringUtils.EllipsisString .Repository.Description 300}}">
|
2023-09-01 12:59:24 -04:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
<meta property="og:type" content="object">
|
|
|
|
{{if (.Repository.AvatarLink ctx)}}
|
|
|
|
<meta property="og:image" content="{{.Repository.AvatarLink ctx}}">
|
|
|
|
{{else}}
|
|
|
|
<meta property="og:image" content="{{.Repository.Owner.AvatarLink ctx}}">
|
|
|
|
{{end}}
|
|
|
|
{{else}}
|
2024-06-07 13:12:48 -04:00
|
|
|
<meta property="og:title" content="{{AppDisplayName}}">
|
2023-09-01 12:59:24 -04:00
|
|
|
<meta property="og:type" content="website">
|
|
|
|
<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png">
|
|
|
|
<meta property="og:url" content="{{AppUrl}}">
|
|
|
|
<meta property="og:description" content="{{MetaDescription}}">
|
|
|
|
{{end}}
|
2024-06-07 13:12:48 -04:00
|
|
|
<meta property="og:site_name" content="{{AppDisplayName}}">
|