feat: Add summary card for repos and releases

This commit is contained in:
JakobDev 2024-12-14 19:36:09 +01:00
parent f5cfdd80a7
commit 7685a1e98e
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
11 changed files with 673 additions and 247 deletions

View file

@ -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}}