Monorepo for Tangled
1{{ define "repo/fragments/og" }}
2 {{ $title := or .Title .RepoInfo.FullName }}
3 {{ $description := or .Description .RepoInfo.Description "A repository on Tangled" }}
4 {{ $url := or .Url (printf "https://tangled.org/%s" .RepoInfo.FullName) }}
5 {{ $imageUrl := printf "https://tangled.org/%s/opengraph" .RepoInfo.FullName }}
6 {{ $ownerHandle := resolve .RepoInfo.OwnerDid }}
7
8 <!-- Open Graph Meta Tags -->
9 <meta property="og:title" content="{{ unescapeHtml $title }}" />
10 <meta property="og:type" content="article" />
11 <meta property="og:url" content="{{ $url }}" />
12 <meta property="og:description" content="{{ $description }}" />
13 <meta property="og:image" content="{{ $imageUrl }}" />
14 <meta property="og:image:width" content="1200" />
15 <meta property="og:image:height" content="600" />
16 <meta property="og:image:alt" content="{{ unescapeHtml $title }}" />
17 <meta property="article:author" content="{{ $ownerHandle }}" />
18 {{ if .RepoInfo.Topics }}
19 {{ range .RepoInfo.Topics }}
20 <meta property="article:tag" content="{{ . }}" />
21 {{ end }}
22 {{ end }}
23
24 <!-- Twitter Card Meta Tags -->
25 <meta name="twitter:card" content="summary_large_image" />
26 <meta name="twitter:title" content="{{ unescapeHtml $title }}" />
27 <meta name="twitter:description" content="{{ $description }}" />
28 <meta name="twitter:image" content="{{ $imageUrl }}" />
29 <meta name="twitter:image:alt" content="{{ unescapeHtml $title }}" />
30
31 <!-- Additional SEO -->
32 <meta name="description" content="{{ $description }}" />
33 <link rel="canonical" href="{{ $url }}" />
34{{ end }}