feat: add OG meta tags to home page, tag browse, and profile bio

Complete Open Graph coverage across all public pages:

- Home page: og:title (site name), og:description, og:type=website,
  og:url, og:site_name
- Tag browse: og:title with tag name, og:description with count,
  og:url, og:site_name
- Profile: add og:description using bio (truncated to 200 chars)
  with fallback to generic text

Previously only fave detail and profile (without description) had
OG tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-04-07 10:54:23 +02:00
commit fe925fc292
3 changed files with 27 additions and 0 deletions

View file

@ -1,3 +1,13 @@
{{define "head"}}
<meta property="og:title" content="{{.SiteName}}">
<meta property="og:description" content="Lagre og del dine favoritter">
<meta property="og:type" content="website">
{{if .ExternalURL}}
<meta property="og:url" content="{{.ExternalURL}}">
{{end}}
<meta property="og:site_name" content="{{.SiteName}}">
{{end}}
{{define "content"}} {{define "content"}}
{{if .User}} {{if .User}}
<hgroup> <hgroup>

View file

@ -2,6 +2,11 @@
{{with .Data}}{{$d := .}}{{with .ProfileUser}} {{with .Data}}{{$d := .}}{{with .ProfileUser}}
{{if eq .ProfileVisibility "public"}} {{if eq .ProfileVisibility "public"}}
<meta property="og:title" content="{{.DisplayNameOrUsername}} sine favoritter"> <meta property="og:title" content="{{.DisplayNameOrUsername}} sine favoritter">
{{if .Bio}}
<meta property="og:description" content="{{truncate 200 .Bio}}">
{{else}}
<meta property="og:description" content="{{.DisplayNameOrUsername}} sine favoritter på {{$.SiteName}}">
{{end}}
<meta property="og:type" content="profile"> <meta property="og:type" content="profile">
{{if $.ExternalURL}} {{if $.ExternalURL}}
<meta property="og:url" content="{{$.ExternalURL}}/u/{{.Username}}"> <meta property="og:url" content="{{$.ExternalURL}}/u/{{.Username}}">

View file

@ -1,3 +1,15 @@
{{define "head"}}
{{with .Data}}
<meta property="og:title" content="Favoritter med merkelapp: {{.TagName}}">
<meta property="og:description" content="{{.Total}} offentlige favoritter med merkelappen «{{.TagName}}»">
<meta property="og:type" content="website">
{{if $.ExternalURL}}
<meta property="og:url" content="{{$.ExternalURL}}/tags/{{.TagName}}">
{{end}}
<meta property="og:site_name" content="{{$.SiteName}}">
{{end}}
{{end}}
{{define "content"}} {{define "content"}}
{{with .Data}} {{with .Data}}
<hgroup> <hgroup>