mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
feat: Add summary card for repos and releases
This commit is contained in:
parent
f5cfdd80a7
commit
7685a1e98e
11 changed files with 673 additions and 247 deletions
|
@ -1,4 +1,16 @@
|
|||
{{- /* og:description - a one to two sentence description of your object, maybe it only needs at most 300 bytes */ -}}
|
||||
{{if .OpenGraphTitle}}
|
||||
<meta property="og:title" content="{{.OpenGraphTitle}}">
|
||||
{{end}}
|
||||
{{if .OpenGraphDescription}}
|
||||
<meta property="og:description" content="{{.OpenGraphDescription}}">
|
||||
{{end}}
|
||||
{{if .OpenGraphURL}}
|
||||
<meta property="og:url" content="{{.OpenGraphURL}}">
|
||||
{{end}}
|
||||
{{if .OpenGraphImageURL}}
|
||||
<meta property="og:image" content="{{.OpenGraphImageURL}}">
|
||||
{{end}}
|
||||
{{if .PageIsUserProfile}}
|
||||
<meta property="og:title" content="{{.ContextUser.DisplayName}}">
|
||||
<meta property="og:type" content="profile">
|
||||
|
@ -35,14 +47,18 @@
|
|||
<meta property="og:description" content="{{StringUtils.EllipsisString .Repository.Description 300}}">
|
||||
{{end}}
|
||||
{{else}}
|
||||
<meta property="og:title" content="{{.Repository.Name}}">
|
||||
<meta property="og:url" content="{{.Repository.HTMLURL}}">
|
||||
{{if .Repository.Description}}
|
||||
{{if not .OpenGraphTitle}}
|
||||
<meta property="og:title" content="{{.Repository.Name}}">
|
||||
{{end}}
|
||||
{{if not .OpenGraphURL}}
|
||||
<meta property="og:url" content="{{.Repository.HTMLURL}}">
|
||||
{{end}}
|
||||
{{if and (.Repository.Description) (not .OpenGraphDescription)}}
|
||||
<meta property="og:description" content="{{StringUtils.EllipsisString .Repository.Description 300}}">
|
||||
{{end}}
|
||||
{{end}}
|
||||
<meta property="og:type" content="object">
|
||||
{{if not .Issue}}
|
||||
{{if and (not .Issue) (not .OpenGraphImageURL)}}
|
||||
{{if (.Repository.AvatarLink ctx)}}
|
||||
<meta property="og:image" content="{{.Repository.AvatarLink ctx}}">
|
||||
{{else}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue