Skip to content

Commit 1f76d88

Browse files
indiVar0508claude
andcommitted
Fix embeds, search and archive bugs, and add Paper-n-PiP
Fixes and improvements from a pass over Chrome's modern-web-guidance catalogue, plus homepage content requested by the organisers. Bugs fixed - Post photos and embeds all loaded up front. Post bodies now lazy-load them, except the first photo in posts without a cover image - Four September 2019 photos were 2-5 MB each (14.4 MB in total, with GPS data). Resized to 1600 px wide: 0.85 MB - None of the 25 embeds had a title for screen readers. All have one now, and YouTube embeds use youtube-nocookie.com - The CSP blocked 7 Instagram embeds and a slides embed. Link to the 4 Instagram posts that still exist; drop the 3 deleted ones and the slides deck, which returns 404 - Scrolling over the open search dialog scrolled the page behind it - Jump-to-year links on /blog/ left the year heading under the sticky year rail - Copy link was not announced to screen readers and failed silently Improvements - Prefetch same-site pages on hover with speculation rules; the CSP allows them with 'inline-speculation-rules', not 'unsafe-inline' - Search dialog closes on outside click with closedby="any" and on its close button with command="close", with fallbacks for older browsers - <search> landmark, role="list" on unstyled lists for Safari, keyboard-focusable code blocks that scroll sideways - text-scale meta, text-wrap: pretty in posts, low fetch priority for analytics and Giscus, normal-width scrollbar on the year rail Content - Homepage callout, footer and About links for "How BangPypers is run", which was only a one-line mention at the bottom of the homepage - Paper-n-PiP section on the homepage with the three newest sessions from _data/paper_n_pip.yml, links to the playlist and to meetup-talks for proposing a session - Note that meetups are free: if Meetup asks for payment on RSVP, choose "Continue without paying" check_blogs.rb now also checks embed titles and lazy loading, the speculation rules and CSP keyword, the homepage callout, the free-meetup note and the Paper-n-PiP data and section. Each check was broken on purpose to confirm it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bbe48ec commit 1f76d88

34 files changed

Lines changed: 341 additions & 98 deletions

‎_data/paper_n_pip.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Paper-n-PiP: online sessions on Discord where a member walks through a
2+
# research paper or a Python topic. Recordings go to the YouTube playlist.
3+
# The homepage shows the three newest episodes.
4+
#
5+
# To add an episode, put it at the top of `episodes`:
6+
# title: the talk or paper title
7+
# speaker: the presenter's name
8+
# date: the day of the session (YYYY-MM-DD)
9+
# video: the YouTube video id, the part after "watch?v="
10+
playlist: "https://www.youtube.com/playlist?list=PLUEJaUU77KhM"
11+
episodes:
12+
- title: "What's up with Python 3.15"
13+
speaker: "Tushar Sadhwani"
14+
date: 2026-09-13
15+
video: "-7pNdYCOpgA"
16+
- title: "Wheels, WebAssembly, and scientific Python, the Pyodide way"
17+
speaker: "Agriya Khetarpal"
18+
date: 2026-08-09
19+
video: "_8ohiR4_zD4"
20+
- title: "GDPval: Evaluating AI Model Performance on Real-World Economically Valuable Tasks"
21+
speaker: "Jayita Bhattacharyya"
22+
date: 2026-06-27
23+
video: "FHHtGG4j-M4"

‎_includes/footer.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ <h2 id="footer-read">Read</h2>
2424
<h2 id="footer-join">Take part</h2>
2525
<ul>
2626
<li><a href="https://www.meetup.com/BangPypers/">Attend a meetup</a></li>
27+
<li><a href="{{ site.data.paper_n_pip.playlist }}">Watch Paper-n-PiP</a></li>
2728
<li><a href="https://github.com/bangpypers/meetup-talks">Propose a talk</a></li>
2829
<li><a href="{% post_url /community/2026-04-20-welcome-to-the-community-blog %}">Write a community post</a></li>
30+
<li><a href="{% post_url 2017-06-03-how-bangpypers-is-run %}">How BangPypers is run</a></li>
2931
<li><a href="{{ '/about/' | relative_url }}">About BangPypers</a></li>
3032
</ul>
3133
</nav>

‎_includes/giscus.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ <h2 id="comments-title" class="h4">Join the conversation</h2>
1818
data-lang="en"
1919
data-loading="lazy"
2020
crossorigin="anonymous"
21-
async>
21+
async
22+
fetchpriority="low">
2223
</script>
2324
<noscript>Enable JavaScript to view comments, or visit our
2425
<a href="https://github.com/{{ site.giscus.repo | escape }}/discussions/categories/{{ site.giscus.category | slugify }}">GitHub Discussions</a>.</noscript>

‎_includes/head.html‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,20 @@
3636

3737
<meta charset="utf-8">
3838
<meta name="viewport" content="width=device-width, initial-scale=1">
39+
{%- comment -%}
40+
Lets supporting browsers scale 1rem with the phone's text size setting.
41+
Every size in main.css is in rem/em, and nothing sets a root font-size.
42+
{%- endcomment %}
43+
<meta name="text-scale" content="scale">
3944
{%- if jekyll.environment == "production" %}
4045
{%- comment -%}
4146
GitHub Pages cannot send response headers, so the policy is delivered in a
4247
meta tag. Keep it in sync when adding third-party embeds. frame-ancestors,
4348
report-uri and sandbox are not supported in meta policies.
49+
'inline-speculation-rules' allows only the speculation rules below, not
50+
inline JavaScript.
4451
{%- endcomment %}
45-
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' https://giscus.app https://www.googletagmanager.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://giscus.app; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; media-src 'self' https:; frame-src https://giscus.app https://www.youtube.com https://www.youtube-nocookie.com https://embed.ente.io https://embed.ente.com https://airtable.com; connect-src 'self' https://*.google-analytics.com https://*.analytics.google.com https://www.googletagmanager.com; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests">
52+
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'inline-speculation-rules' https://giscus.app https://www.googletagmanager.com;style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://giscus.app; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; media-src 'self' https:; frame-src https://giscus.app https://www.youtube.com https://www.youtube-nocookie.com https://embed.ente.io https://embed.ente.com https://airtable.com; connect-src 'self' https://*.google-analytics.com https://*.analytics.google.com https://www.googletagmanager.com; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests">
4653
{%- endif %}
4754
<meta name="referrer" content="strict-origin-when-cross-origin">
4855

@@ -80,10 +87,18 @@
8087
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Anek+Latin:wdth,wght@75..125,400..800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400..700;1,8..60,400&display=swap">
8188
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
8289
<script src="{{ '/assets/js/site.js' | relative_url }}" defer></script>
90+
{%- comment -%}
91+
Chromium browsers fetch a same-site page when the reader hovers or presses
92+
on its link, so the click opens it from cache. Feeds, the search index and
93+
files under /assets/ are left out. Other browsers ignore this block.
94+
{%- endcomment %}
95+
<script type="speculationrules">
96+
{"prefetch": [{"where": {"and": [{"href_matches": "/*"}, {"not": {"href_matches": "/*.xml"}}, {"not": {"href_matches": "/*.json"}}, {"not": {"href_matches": "/assets/*"}}]}, "eagerness": "moderate"}]}
97+
</script>
8398

8499
{% include structuredata.html %}
85100

86101
{%- if jekyll.environment == "production" and site.google_analytics %}
87-
<script src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}" async></script>
88-
<script src="{{ '/assets/js/analytics.js' | relative_url }}" data-ga-id="{{ site.google_analytics }}" defer></script>
102+
<script src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}" async fetchpriority="low"></script>
103+
<script src="{{ '/assets/js/analytics.js' | relative_url }}" data-ga-id="{{ site.google_analytics }}" defer fetchpriority="low"></script>
89104
{%- endif %}

‎_includes/header.html‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,24 @@
4242
</div>
4343
</header>
4444

45-
<dialog id="search-dialog" class="search-dialog" aria-labelledby="search-title" data-index="{{ '/search.json' | relative_url }}">
46-
<form class="search-form" role="search" method="dialog">
47-
<h2 id="search-title" class="visually-hidden">Search posts</h2>
48-
<svg aria-hidden="true"><use href="{{ icons }}#search"></use></svg>
49-
<label class="visually-hidden" for="search-input">Search posts</label>
50-
<input id="search-input" type="search" placeholder="Search talks, speakers, topics" autocomplete="off" spellcheck="false" maxlength="100">
51-
<button class="icon-button" type="button" data-close-search>
52-
<svg aria-hidden="true"><use href="{{ icons }}#close"></use></svg>
53-
<span class="visually-hidden">Close search</span>
54-
</button>
55-
</form>
45+
{%- comment -%}
46+
closedby="any" closes the dialog on a click outside it, and command="close"
47+
wires the close button, without script. site.js adds both where a browser
48+
lacks them.
49+
{%- endcomment %}
50+
<dialog id="search-dialog" class="search-dialog" aria-labelledby="search-title" closedby="any" data-index="{{ '/search.json' | relative_url }}">
51+
<search>
52+
<form class="search-form" method="dialog">
53+
<h2 id="search-title" class="visually-hidden">Search posts</h2>
54+
<svg aria-hidden="true"><use href="{{ icons }}#search"></use></svg>
55+
<label class="visually-hidden" for="search-input">Search posts</label>
56+
<input id="search-input" type="search" placeholder="Search talks, speakers, topics" autocomplete="off" spellcheck="false" maxlength="100">
57+
<button class="icon-button" type="button" command="close" commandfor="search-dialog">
58+
<svg aria-hidden="true"><use href="{{ icons }}#close"></use></svg>
59+
<span class="visually-hidden">Close search</span>
60+
</button>
61+
</form>
62+
</search>
5663
<p class="search-status" role="status" aria-live="polite"></p>
57-
<ol class="search-results"></ol>
64+
<ol class="search-results" role="list"></ol>
5865
</dialog>

‎_includes/share.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
{%- assign share_title = page.title | url_encode -%}
44
<div class="share">
55
<p>Share this post</p>
6-
<ul>
6+
<ul role="list">
77
<li><a href="https://www.linkedin.com/sharing/share-offsite/?url={{ share_url }}" target="_blank" rel="noopener noreferrer">
88
<svg aria-hidden="true"><use href="{{ icons }}#linkedin-in"></use></svg>LinkedIn</a></li>
99
<li><a href="https://x.com/intent/post?text={{ share_title }}&amp;url={{ share_url }}" target="_blank" rel="noopener noreferrer">
1010
<svg aria-hidden="true"><use href="{{ icons }}#x"></use></svg>X</a></li>
1111
<li><a href="https://www.facebook.com/sharer/sharer.php?u={{ share_url }}" target="_blank" rel="noopener noreferrer">
1212
<svg aria-hidden="true"><use href="{{ icons }}#facebook"></use></svg>Facebook</a></li>
1313
<li><button type="button" data-copy-url="{{ page.url | absolute_url }}">
14-
<svg aria-hidden="true"><use href="{{ icons }}#link"></use></svg><span>Copy link</span></button></li>
14+
<svg aria-hidden="true"><use href="{{ icons }}#link"></use></svg>Copy link</button>
15+
<span class="copy-status" role="status"></span></li>
1516
</ul>
1617
</div>

‎_includes/year-list.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{%- for year in by_year %}
1313
<section class="year-group" id="y{{ year.name }}" aria-labelledby="y{{ year.name }}-title">
1414
<h2 id="y{{ year.name }}-title">{{ year.name }} <span class="year-count">{{ year.items.size }} post{% if year.items.size != 1 %}s{% endif %}</span></h2>
15-
<ol class="post-list">
15+
<ol class="post-list" role="list">
1616
{%- for post in year.items %}
1717
<li>
1818
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%-d %b" }}</time>

‎_layouts/archive.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1>
3333
<p class="archive-count">{{ archive_posts.size }} post{% if archive_posts.size != 1 %}s{% endif %}</p>
3434
{%- endif %}
3535

36-
<ul class="post-grid">
36+
<ul class="post-grid" role="list">
3737
{%- for post in archive_posts %}
3838
{% include postbox.html %}
3939
{%- endfor %}

‎_layouts/post.html‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
{%- if page.image -%}
1010
{%- if page.image contains "://" -%}{%- assign cover = page.image -%}{%- else -%}{%- assign cover = page.image | relative_url -%}{%- endif -%}
1111
{%- endif -%}
12+
{%- comment -%}
13+
Photos and embeds in the post body load as the reader scrolls near them.
14+
Without a cover image, the first photo may be the largest thing on screen,
15+
so it still loads straight away.
16+
{%- endcomment -%}
17+
{%- assign body = content | replace: '<iframe ', '<iframe loading="lazy" ' | replace: '<img ', '<img loading="lazy" ' -%}
18+
{%- unless cover -%}
19+
{%- assign body = body | replace_first: '<img loading="lazy" ', '<img ' -%}
20+
{%- endunless -%}
1221

1322
<article class="post">
1423
<header class="post-header wrap-text">
@@ -48,12 +57,12 @@ <h1>{{ page.title }}</h1>
4857
{%- endif %}
4958

5059
<div class="prose wrap-text">
51-
{{ content }}
60+
{{ body }}
5261
</div>
5362

5463
<footer class="post-footer wrap-text">
5564
{%- if page.categories.size > 0 %}
56-
<ul class="tags" aria-label="Tags">
65+
<ul class="tags" role="list" aria-label="Tags">
5766
{%- assign sorted_categories = page.categories | sort %}
5867
{%- for category in sorted_categories %}
5968
{%- assign category_slug = category | slugify %}

‎_posts/2012-12-07-november-meetup.md‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,12 @@ We had mix of audience beginners, intermediate, advanced.
1919
[Baiju][] gave [Introduction][] about python usage, history, comparision for 7 minutes. Video is uploaded in Youtube [channel][].
2020

2121

22-
<iframe frameborder="0" allowfullscreen="" width="560" height="315"
23-
src="https://www.youtube.com/embed/lING02S6AAc?wmode=transparent&showinfo=0&rel=0&autohide=1&autoplay=0"
24-
frameborder="0" allowfullscreen>
25-
</iframe>
22+
<iframe title="Video: Baiju's introduction to Python" width="560" height="315" src="https://www.youtube-nocookie.com/embed/lING02S6AAc?rel=0" allowfullscreen></iframe>
2623

2724
There was another talk by [Nandhakumar][] about [django_social_auth][] experience around 1 hour. Here is the [video][].
2825

2926

30-
<iframe frameborder="0" width="560" height="315" allowfullscreen=""
31-
src="https://www.youtube.com/embed/0ek8W2CfdAk?wmode=transparent&showinfo=0&rel=0&autohide=1&autoplay=0" frameborder="0" allowfullscreen>
32-
</iframe>
27+
<iframe title="Video: Nandhakumar on django_social_auth" width="560" height="315" src="https://www.youtube-nocookie.com/embed/0ek8W2CfdAk?rel=0" allowfullscreen></iframe>
3328

3429

3530
[Bangpypers][] has a youtube playlist, please share the info.

0 commit comments

Comments
 (0)