tangled
alpha
login
or
join now
ligo.at
/
core
decentralized and customizable links page on top of atproto
5
fork
atom
overview
issues
2
pulls
pipelines
profile metadata and open graph
nauta.one
3 months ago
1b7c0778
93e08011
+16
-4
2 changed files
expand all
collapse all
unified
split
src
main.py
templates
profile.html
+1
-2
src/main.py
···
85
# remove the ?reload parameter
86
return redirect(request.path)
87
0
88
athref = f"at://{did}/at.ligo.actor.links/self"
89
-
canonical = f"https://ligo.at/{f'@{handle}' if handle else did}"
90
return render_template(
91
"profile.html",
92
profile=profile,
93
links=links,
94
-
canonical=canonical,
95
athref=athref,
96
)
97
···
85
# remove the ?reload parameter
86
return redirect(request.path)
87
88
+
profile["handle"] = handle
89
athref = f"at://{did}/at.ligo.actor.links/self"
0
90
return render_template(
91
"profile.html",
92
profile=profile,
93
links=links,
0
94
athref=athref,
95
)
96
+15
-2
src/templates/profile.html
···
2
<html>
3
<head>
4
<meta charset="utf-8" />
0
0
5
<title>Links for {{ profile.displayName }}</title>
0
0
0
0
0
0
0
0
0
0
0
0
0
6
<meta name="viewport" content="width=device-width, initial-scale=1" />
7
<base target="_blank" />
8
<link rel="stylesheet" href="{{ url_for('static', filename='inter.css') }}" />
···
10
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon-16.png') }}" />
11
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicon-32.png') }}" />
12
<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
</head>
16
<body>
17
<div class="wrapper profile">
···
2
<html>
3
<head>
4
<meta charset="utf-8" />
5
+
<!-- metadata and open graph -->
6
+
<meta property="og:type" content="profile" />
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 -->
21
<meta name="viewport" content="width=device-width, initial-scale=1" />
22
<base target="_blank" />
23
<link rel="stylesheet" href="{{ url_for('static', filename='inter.css') }}" />
···
25
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon-16.png') }}" />
26
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicon-32.png') }}" />
27
<link rel="icon" type="image/png" sizes="48x48" href="{{ url_for('static', filename='favicon-48.png') }}" />
0
0
28
</head>
29
<body>
30
<div class="wrapper profile">