Skip to content

Commit 2095fbf

Browse files
Add OpenGraph and Twitter Card meta tags to public pages
- Add base OpenGraph tags to base.html template - og:title, og:description, og:type, og:url, og:image - og:image:alt, og:site_name, og:locale - Add Twitter Card meta tags to base.html - twitter:card, twitter:title, twitter:description - twitter:image, twitter:image:alt - Implement custom OpenGraph blocks for public pages: - Homepage (index.html) - Stats page (stats.html) - Volunteer page (volunteer/index.html) - Sponsorship page (sponsorship/sponsorshipprofile_list.html) - Login page (account/login.html) - Signup page (account/signup.html) All pages now have proper social media preview tags that can be tested with browser extensions or social media preview tools. #244 # Conflicts: # templates/portal/stats.html # templates/volunteer/index.html
1 parent f5e9338 commit 2095fbf

File tree

7 files changed

+518
-427
lines changed

7 files changed

+518
-427
lines changed

sponsorship/templates/sponsorship/sponsorshipprofile_list.html

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22
{% load allauth i18n %}
33
{% load django_bootstrap5 %}
44
{% load render_table from django_tables2 %}
5+
{% block head_title %}
6+
PyLadiesCon Portal - Sponsorship
7+
{% endblock head_title %}
8+
{% block og_title %}
9+
PyLadiesCon Portal - Sponsorship
10+
{% endblock og_title %}
11+
{% block og_description %}
12+
View and manage sponsorships for PyLadiesCon. Support the global PyLadies conference by becoming a sponsor.
13+
{% endblock og_description %}
514
{% block body %}
615
{% endblock body %}
716
{% block content %}
8-
<h1 class="display-5">
9-
{% if request.user.is_superuser %}
10-
Manage Sponsors <a class="btn btn-primary"
11-
href="{% url 'sponsorship:sponsorship_profile_new' %}">Add New Sponsor</a>
12-
{% else %}
13-
View Sponsors
14-
{% endif %}
15-
</h1>
16-
{% include "sponsorship/sponsorship_stats.html" %}
17-
{% if filter %}
18-
<form action="" method="get" class="form">
19-
{% bootstrap_form filter.form %}
20-
{% bootstrap_button 'Search' %}
21-
{% if filter.form.is_bound %}
22-
<a href="{% url 'sponsorship:sponsorship_list' %}"
23-
class="btn btn-secondary">Reset Filters</a>
24-
{% endif %}
25-
</form>
17+
<h1 class="display-5">
18+
{% if request.user.is_superuser %}
19+
Manage Sponsors <a class="btn btn-primary" href="{% url 'sponsorship:sponsorship_profile_new' %}">Add New
20+
Sponsor</a>
21+
{% else %}
22+
View Sponsors
2623
{% endif %}
27-
{% render_table table %}
28-
{% endblock content %}
24+
</h1>
25+
{% include "sponsorship/sponsorship_stats.html" %}
26+
{% if filter %}
27+
<form action="" method="get" class="form">
28+
{% bootstrap_form filter.form %}
29+
{% bootstrap_button 'Search' %}
30+
{% if filter.form.is_bound %}
31+
<a href="{% url 'sponsorship:sponsorship_list' %}" class="btn btn-secondary">Reset Filters</a>
32+
{% endif %}
33+
</form>
34+
{% endif %}
35+
{% render_table table %}
36+
{% endblock content %}

templates/account/login.html

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,28 @@
22
{% load i18n %}
33
{% load allauth account %}
44
{% block head_title %}
5-
{% trans "Sign In" %}
5+
{% trans "Sign In" %}
66
{% endblock head_title %}
7+
{% block og_title %}
8+
PyLadiesCon Portal - Sign In
9+
{% endblock og_title %}
10+
{% block og_description %}
11+
Sign in to PyLadiesCon Portal to manage your volunteer profile, sponsorships, and contribute to the conference.
12+
{% endblock og_description %}
713
{% block content %}
8-
{% element h1 %}
9-
{% trans "Sign In" %}
14+
{% element h1 %}
15+
{% trans "Sign In" %}
1016
{% endelement %}
1117
{% if not SOCIALACCOUNT_ONLY %}
12-
{% setvar link %}
13-
<a href="{{ signup_url }}">
18+
{% setvar link %}
19+
<a href="{{ signup_url }}">
1420
{% endsetvar %}
1521
{% setvar end_link %}
1622
</a>
1723
{% endsetvar %}
1824
{% element p %}
19-
{% blocktranslate %}If you have not created an account yet, then please {{ link }}sign up{{ end_link }} first.{% endblocktranslate %}
25+
{% blocktranslate %}If you have not created an account yet, then please {{ link }}sign up{{ end_link }} first.{%
26+
endblocktranslate %}
2027
{% endelement %}
2128
{% url 'account_login' as login_url %}
2229
{% element form form=form method="post" action=login_url tags="entrance,login" %}
@@ -34,28 +41,28 @@
3441
{% endelement %}
3542
{% endif %}
3643
{% if LOGIN_BY_CODE_ENABLED or PASSKEY_LOGIN_ENABLED %}
37-
{% element hr %}
44+
{% element hr %}
3845
{% endelement %}
3946
{% element button_group vertical=True %}
4047
{% if PASSKEY_LOGIN_ENABLED %}
41-
{% element button type="submit" form="mfa_login" id="passkey_login" tags="prominent,login,outline,primary" %}
42-
{% trans "Sign in with a passkey" %}
48+
{% element button type="submit" form="mfa_login" id="passkey_login" tags="prominent,login,outline,primary" %}
49+
{% trans "Sign in with a passkey" %}
4350
{% endelement %}
4451
{% endif %}
4552
{% if LOGIN_BY_CODE_ENABLED %}
46-
{% element button href=request_login_code_url tags="prominent,login,outline,primary" %}
47-
{% trans "Send me a sign-in code" %}
53+
{% element button href=request_login_code_url tags="prominent,login,outline,primary" %}
54+
{% trans "Send me a sign-in code" %}
4855
{% endelement %}
4956
{% endif %}
5057
{% endelement %}
5158
{% endif %}
5259
{% if SOCIALACCOUNT_ENABLED %}
53-
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
60+
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
5461
{% endif %}
5562
{% endblock content %}
5663
{% block extra_body %}
57-
{{ block.super }}
58-
{% if PASSKEY_LOGIN_ENABLED %}
59-
{% include "mfa/webauthn/snippets/login_script.html" with button_id="passkey_login" %}
60-
{% endif %}
61-
{% endblock extra_body %}
64+
{{ block.super }}
65+
{% if PASSKEY_LOGIN_ENABLED %}
66+
{% include "mfa/webauthn/snippets/login_script.html" with button_id="passkey_login" %}
67+
{% endif %}
68+
{% endblock extra_body %}

templates/account/signup.html

Lines changed: 73 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,95 +2,100 @@
22
{% load allauth i18n %}
33
{% load django_bootstrap5 %}
44
{% block head_title %}
5-
{% trans "Signup" %}
5+
{% trans "Signup" %}
66
{% endblock head_title %}
7+
{% block og_title %}
8+
PyLadiesCon Portal - Sign Up
9+
{% endblock og_title %}
10+
{% block og_description %}
11+
Create an account on PyLadiesCon Portal to join as a volunteer, view sponsorships, and be part of the global PyLadies
12+
conference community.
13+
{% endblock og_description %}
714
{% block content %}
8-
{% element h1 %}
9-
{% trans "Sign Up" %}
15+
{% element h1 %}
16+
{% trans "Sign Up" %}
1017
{% endelement %}
1118
{% setvar link %}
1219
<a href="{{ login_url }}">
13-
{% endsetvar %}
14-
{% setvar end_link %}
20+
{% endsetvar %}
21+
{% setvar end_link %}
1522
</a>
1623
{% endsetvar %}
1724
{% element p %}
1825
{% blocktranslate %}Already have an account? Then please {{ link }}sign in{{ end_link }}.{% endblocktranslate %}
1926
{% endelement %}
2027
{% if not SOCIALACCOUNT_ONLY %}
21-
{% url 'account_signup' as action_url %}
22-
<form method="post" action="{{ action_url }}" class="entrance signup">
23-
{% csrf_token %}
24-
<h3 class="mb-3">
25-
Personal Information
26-
</h3>
27-
{% bootstrap_field form.username %}
28-
{% bootstrap_field form.email %}
29-
{% bootstrap_field form.first_name %}
30-
{% bootstrap_field form.last_name %}
31-
<h3 class="mb-3">
32-
Password
33-
</h3>
34-
{% bootstrap_field form.password1 %}
35-
{% bootstrap_field form.password2 %}
36-
<h3 class="mb-3">
37-
Agreements
38-
</h3>
39-
<div class="card mb-3">
40-
<div class="card-body">
41-
<p>
42-
By creating an account, you are agreeing to our terms and conditions.
43-
</p>
44-
<div class="form-check mb-3">
45-
{{ form.coc_agreement }}
46-
<label class="form-check-label" for="{{ form.coc_agreement.id_for_label }}">
47-
I agree to the <a href="https://2025.conference.pyladies.com/en/coc/"
48-
target="_blank"
49-
rel="noopener noreferrer">Code of Conduct</a>
50-
</label>
51-
{% if form.coc_agreement.errors %}
52-
<div class="invalid-feedback d-block">
53-
{{ form.coc_agreement.errors }}
54-
</div>
55-
{% endif %}
56-
<div class="form-text">
57-
{{ form.coc_agreement.help_text }}
58-
</div>
28+
{% url 'account_signup' as action_url %}
29+
<form method="post" action="{{ action_url }}" class="entrance signup">
30+
{% csrf_token %}
31+
<h3 class="mb-3">
32+
Personal Information
33+
</h3>
34+
{% bootstrap_field form.username %}
35+
{% bootstrap_field form.email %}
36+
{% bootstrap_field form.first_name %}
37+
{% bootstrap_field form.last_name %}
38+
<h3 class="mb-3">
39+
Password
40+
</h3>
41+
{% bootstrap_field form.password1 %}
42+
{% bootstrap_field form.password2 %}
43+
<h3 class="mb-3">
44+
Agreements
45+
</h3>
46+
<div class="card mb-3">
47+
<div class="card-body">
48+
<p>
49+
By creating an account, you are agreeing to our terms and conditions.
50+
</p>
51+
<div class="form-check mb-3">
52+
{{ form.coc_agreement }}
53+
<label class="form-check-label" for="{{ form.coc_agreement.id_for_label }}">
54+
I agree to the <a href="https://2025.conference.pyladies.com/en/coc/" target="_blank"
55+
rel="noopener noreferrer">Code of Conduct</a>
56+
</label>
57+
{% if form.coc_agreement.errors %}
58+
<div class="invalid-feedback d-block">
59+
{{ form.coc_agreement.errors }}
5960
</div>
60-
<div class="form-check">
61-
{{ form.tos_agreement }}
62-
<label class="form-check-label" for="{{ form.tos_agreement.id_for_label }}">
63-
I agree to the <a href="https://pyladiescon-portal-docs.netlify.app/policies/terms_of_use/"
64-
target="_blank"
65-
rel="noopener noreferrer">Terms of Service</a>
66-
</label>
67-
{% if form.tos_agreement.errors %}
68-
<div class="invalid-feedback d-block">
69-
{{ form.tos_agreement.errors }}
70-
</div>
71-
{% endif %}
72-
<div class="form-text">
73-
{{ form.tos_agreement.help_text }}
74-
</div>
61+
{% endif %}
62+
<div class="form-text">
63+
{{ form.coc_agreement.help_text }}
64+
</div>
65+
</div>
66+
<div class="form-check">
67+
{{ form.tos_agreement }}
68+
<label class="form-check-label" for="{{ form.tos_agreement.id_for_label }}">
69+
I agree to the <a href="https://pyladiescon-portal-docs.netlify.app/policies/terms_of_use/"
70+
target="_blank" rel="noopener noreferrer">Terms of Service</a>
71+
</label>
72+
{% if form.tos_agreement.errors %}
73+
<div class="invalid-feedback d-block">
74+
{{ form.tos_agreement.errors }}
75+
</div>
76+
{% endif %}
77+
<div class="form-text">
78+
{{ form.tos_agreement.help_text }}
7579
</div>
7680
</div>
7781
</div>
78-
{{ redirect_field }}
79-
<div class="d-grid gap-2">
80-
<button class="btn btn-primary btn-lg" type="submit">
81-
{% trans "Sign Up" %}
82-
</button>
83-
</div>
84-
</form>
82+
</div>
83+
{{ redirect_field }}
84+
<div class="d-grid gap-2">
85+
<button class="btn btn-primary btn-lg" type="submit">
86+
{% trans "Sign Up" %}
87+
</button>
88+
</div>
89+
</form>
8590
{% endif %}
8691
{% if PASSKEY_SIGNUP_ENABLED %}
87-
{% element hr %}
92+
{% element hr %}
8893
{% endelement %}
8994
{% element button href=signup_by_passkey_url tags="prominent,signup,outline,primary" %}
9095
{% trans "Sign up using a passkey" %}
9196
{% endelement %}
9297
{% endif %}
9398
{% if SOCIALACCOUNT_ENABLED %}
94-
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
99+
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
95100
{% endif %}
96-
{% endblock content %}
101+
{% endblock content %}

templates/portal/base.html

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,25 @@
1414
</title>
1515
<link rel="icon" type="image/png" href="{% static 'favicon.png' %}" />
1616
<link rel="apple-touch-icon" type="image/png" href="{% static 'favicon.png' %}" />
17-
{# Standard meta description for search engines and social preview fallbacks #}
18-
<meta name="description"
19-
content="{% block meta_description %}PyLadiesCon volunteer portal and conference management system{% endblock meta_description %}" />
20-
21-
{# Open Graph tags (can be overridden per-page) #}
2217
<meta property="og:title" content="{% block og_title %}PyLadiesCon Portal{% endblock og_title %}" />
2318
<meta property="og:description"
2419
content="{% block og_description %}PyLadiesCon volunteer portal and conference management system{% endblock og_description %}" />
2520
<meta property="og:type" content="{% block og_type %}website{% endblock og_type %}" />
26-
<link rel="canonical" href="{% block og_url %}{{ request.build_absolute_uri }}{% endblock og_url %}" />
2721
<meta property="og:url" content="{% block og_url %}{{ request.build_absolute_uri }}{% endblock og_url %}" />
2822
<meta property="og:image"
2923
content="{% block og_image %}https://conference.pyladies.com/img/banner.png{% endblock og_image %}" />
3024
<meta property="og:image:alt" content="{% block og_image_alt %}PyLadiesCon logo{% endblock og_image_alt %}">
3125
<meta property="og:site_name" content="PyLadiesCon Portal" />
3226
<meta property="og:locale" content="en_US">
33-
34-
{# Twitter Card tags for better previews on Twitter #}
3527
<meta name="twitter:card" content="{% block twitter_card %}summary_large_image{% endblock twitter_card %}" />
36-
{# Twitter site handle (optional) - override on site-level if desired #}
37-
<meta name="twitter:site" content="{% block twitter_site %}@pyladies{% endblock twitter_site %}" />
38-
<meta name="twitter:title" content="{% block og_title %}PyLadiesCon Portal{% endblock og_title %}" />
28+
<meta name="twitter:title"
29+
content="{% block twitter_title %}{% block og_title_twitter %}PyLadiesCon Portal{% endblock og_title_twitter %}{% endblock twitter_title %}" />
3930
<meta name="twitter:description"
40-
content="{% block og_description %}PyLadiesCon volunteer portal and conference management system{% endblock og_description %}" />
31+
content="{% block twitter_description %}{% block og_description_twitter %}PyLadiesCon volunteer portal and conference management system{% endblock og_description_twitter %}{% endblock twitter_description %}" />
4132
<meta name="twitter:image"
42-
content="{% block og_image %}https://conference.pyladies.com/img/banner.png{% endblock og_image %}" />
43-
<meta name="twitter:image:alt" content="{% block og_image_alt %}PyLadiesCon logo{% endblock og_image_alt %}" />
33+
content="{% block twitter_image %}{% block og_image_twitter %}https://conference.pyladies.com/img/banner.png{% endblock og_image_twitter %}{% endblock twitter_image %}" />
34+
<meta name="twitter:image:alt"
35+
content="{% block twitter_image_alt %}{% block og_image_alt_twitter %}PyLadiesCon logo{% endblock og_image_alt_twitter %}{% endblock twitter_image_alt %}" />
4436
{% block extra_head %}
4537
<script src="https://kit.fontawesome.com/8774ceef9d.js" crossorigin="anonymous"></script>
4638
{% endblock extra_head %}

0 commit comments

Comments
 (0)