decentralized and customizable links page on top of atproto

profile metadata and open graph

Changed files
+16 -4
src
templates
+1 -2
src/main.py
··· 85 85 # remove the ?reload parameter 86 86 return redirect(request.path) 87 87 88 + profile["handle"] = handle 88 89 athref = f"at://{did}/at.ligo.actor.links/self" 89 - canonical = f"https://ligo.at/{f'@{handle}' if handle else did}" 90 90 return render_template( 91 91 "profile.html", 92 92 profile=profile, 93 93 links=links, 94 - canonical=canonical, 95 94 athref=athref, 96 95 ) 97 96
+15 -2
src/templates/profile.html
··· 2 2 <html> 3 3 <head> 4 4 <meta charset="utf-8" /> 5 + <!-- metadata and open graph --> 6 + <meta property="og:type" content="profile" /> 5 7 <title>Links for {{ profile.displayName }}</title> 8 + <meta property="og:title" content="{{ profile.displayName }}" /> 9 + {% if profile.description %} 10 + <meta name="description" content="{{ profile.description }}" /> 11 + <meta property="og:description" content="{{ profile.description }}" /> 12 + {% endif %} 13 + <meta property="og:image" content="https://{{ request.host }}{{ url_for('static', filename='favicon-48.png') }}" /> 14 + {% if profile.handle %} 15 + <link rel="canonical" href="https://{{ request.url }}/@{{ profile.handle }}" /> 16 + <meta property="og:url" content="https://{{ request.url }}/@{{ profile.handle }}" /> 17 + <meta property="profile:username" content="{{ profile.handle }}" /> 18 + {% endif %} 19 + {% if athref %}<link rel="alternate" href="{{ athref }}" />{% endif %} 20 + <!-- styles and favicons --> 6 21 <meta name="viewport" content="width=device-width, initial-scale=1" /> 7 22 <base target="_blank" /> 8 23 <link rel="stylesheet" href="{{ url_for('static', filename='inter.css') }}" /> ··· 10 25 <link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon-16.png') }}" /> 11 26 <link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicon-32.png') }}" /> 12 27 <link rel="icon" type="image/png" sizes="48x48" href="{{ url_for('static', filename='favicon-48.png') }}" /> 13 - {% if canonical %}<link rel="canonical" href="{{ canonical }}" />{% endif %} 14 - {% if athref %}<link rel="alternate" href="{{ athref }}" />{% endif %} 15 28 </head> 16 29 <body> 17 30 <div class="wrapper profile">