Skip to content

Redesign the site and harden it for 2026 - #115

Merged
indiVar0508 merged 3 commits into
masterfrom
redesign/2026-refresh
Nov 15, 2026
Merged

indiVar0508 merged 3 commits into
masterfrom
redesign/2026-refresh

Conversation

@indiVar0508

@indiVar0508 indiVar0508 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Rebuilds the site's theme around the BangPypers brand, replaces the old Mediumish/Bootstrap stack, and fixes several live bugs and security issues. The homepage also gains Paper-n-PiP sessions, a callout for "How BangPypers is run" and a note that meetups are free.

Post text is unchanged. Embeds in old posts got titles, blocked Instagram embeds became links, and four oversized photos were resized. The jobs page's embed, the mailing list links and the About page also changed.

Before merging: repository settings

  • Settings → Pages → Source: GitHub Actions. Required. The classic Pages builder ignores this repo's Gemfile and can't build the new stylesheet, so a merge without this change won't deploy.
  • Settings → Code security → Private vulnerability reporting: on. The footer's "Report a security issue" link and SECURITY.md rely on it.
  • Verify bangalore.pythonindia.org in the organisation's Pages settings and keep "Enforce HTTPS" on, so nobody else can claim the subdomain.
  • Make the build check required on pull requests.

Bugs fixed on the live site

  • Every tag and year archive link returns 404: the classic builder skips jekyll-archives, and _config.yml used the wrong keys (years/months).
  • Search inserted post text and the search query as raw HTML (DOM XSS). Results are now built with textContent.
  • The RSS feed had an empty title, author "Follow" buttons went nowhere, pages had two h1s, and the mailing list links pointed to the retired Mailman 2 archive.
  • Every photo and embed in a post loaded up front. Post bodies now lazy-load them, except the first photo in posts without a cover image.
  • Four photos in the September 2019 post were 2–5 MB each (14.4 MB, with GPS location data). They are resized to 1600 px wide: 0.85 MB.
  • None of the 25 embedded videos and photo albums had a title for screen readers. All have one now, and YouTube embeds use youtube-nocookie.com.

Design and UX

  • New homepage: when and where to come first (Meetup, Discord, Luma, mailing list), then recent write-ups, community posts, Paper-n-PiP sessions and ways to take part.
  • Meetups are free: a highlighted note under the RSVP button says so, and tells readers to choose "Continue without paying" if Meetup asks for payment. The "Attend a meetup" card and the About page repeat it.
  • Paper-n-PiP: a homepage section shows the three newest online sessions, with links to the YouTube playlist and to bangpypers/meetup-talks for proposing a session. To add a session, put an entry at the top of _data/paper_n_pip.yml; the file explains each field.
  • How BangPypers is run: the 2017 post now has a callout under "Take part", plus footer and About links. Before, it was a single grey line at the bottom of the homepage.
  • Logo marks taken from bangpypers/assets, navy #002750 and yellow #FFCA00 palette, Anek Latin and Source Serif 4.
  • Light and dark themes. The site follows the system setting, and a header button remembers the reader's choice; Giscus comments follow it.
  • Posts get reading time, author cards, tags and share links. The blog and archives are grouped by year with a jump-to-year bar, and jumping to a year no longer hides its heading under the sticky bar. New 404 page.
  • Search opens in a native dialog. It closes on an outside click (closedby="any") or its close button (command="close"), with fallback code for browsers without those, and the page behind it no longer scrolls.
  • Accessibility:
    • skip link, landmarks, one h1 per page, one link per card, visible focus, reduced motion respected
    • list semantics kept in Safari, and code blocks that scroll sideways can be reached by keyboard
    • "Copy link" announces its result
    • the site follows the phone's text-size setting (text-scale meta)
  • Homepage CSS and JS went from about 205 KB to about 18 KB gzipped. The search index (52 KB gzipped) loads only when search is opened. In Chromium browsers, hovering a link to another page on the site prefetches it.

Security

  • Content-Security-Policy (production builds only). No inline scripts or event handlers remain in templates, and check_blogs.rb fails if one is added. The prefetch rules are allowed with 'inline-speculation-rules', not 'unsafe-inline'.
  • jQuery, Bootstrap, Popper and the Font Awesome CDN removed: four fewer third-party script origins.
  • Google Analytics loads only in production builds, at low priority.
  • SECURITY.md, /.well-known/security.txt, robots.txt and a sitemap.

Build and deploy

  • Jekyll 4.4.1 with all gems updated.
  • .github/workflows/pages.yml builds every PR and deploys master with actions/deploy-pages (no stored token). Actions are pinned to commit SHAs, permissions are least-privilege, and checkout doesn't keep credentials.
  • Dependabot for gems and actions, waiting 7 days before proposing a new release.
  • Removed .travis.yml and deploy.sh, which pushed using a personal access token.

How to review locally

bundle config set --local path vendor/bundle
bundle install
bundle exec jekyll serve                         # http://localhost:4000
bundle exec ruby scripts/check_blogs.rb
JEKYLL_ENV=production bundle exec jekyll build   # with CSP and analytics, as deployed

Testing

  • check_blogs.rb passes. Each of its checks was tested by breaking it on purpose. It now also covers:
    • embed titles and lazy loading
    • the prefetch rules and their CSP keyword
    • the "How BangPypers is run" callout and the free-meetups note
    • the Paper-n-PiP data and homepage section
  • The build workflow passes on this PR.
  • Checked in Chrome at desktop and 375px widths, in light and dark: homepage, posts, search (including the / shortcut), mobile menu, archives, author pages, 404 and Giscus.
  • Confirmed the CSP blocks inline scripts and unknown frames, and still allows YouTube, Ente, Airtable and Giscus.
  • Tested the theme button in headless Chromium:
    • switching both ways on light and dark systems
    • the saved choice and other open tabs
    • keyboard use, print and no-JavaScript
    • Giscus following the theme
  • 49 further checks in headless Chromium:
    • the search dialog with native closedby and invoker commands, and again with the fallback code
    • the page behind the dialog not scrolling
    • Copy link, lazy loading, jump-to-year, wide code blocks and the Paper-n-PiP cards
    • prefetch on hover in a production build, with no CSP errors
  • Not yet verified: the deploy job, which runs only on master and so first runs on merge, and Dependabot's cooldown setting.

Known effects

  • Old Twitter widget and Speaker Deck scripts inside a few posts are blocked by the CSP. Their quoted text and links still show.
  • The CSP also blocked Instagram and slid.es embeds in 2013–2014 posts. The four Instagram posts that still exist are now links. The three deleted ones and the slides deck (404 on slides.com) were removed.
  • Conflicts with Clarify company job submissions and volunteer introductions #109 on jobposting.md. When resolving, drop the static.airtable.com script: the CSP blocks it, and the form iframe works without it at a fixed height.
  • Cover images have an empty alt until a post sets the new optional image_alt front matter.
  • Paper-n-PiP thumbnails load from i.ytimg.com. They're cropped to 5:2 because the session posters are wide banners inside the video frame. A session with an ordinary 16:9 thumbnail would need the ratio changed in main.scss.

🤖 Generated with Claude Code

indiVar0508 and others added 3 commits November 9, 2026 23:23
Rebuild the theme around the BangPypers brand and drop the legacy
Mediumish/Bootstrap stack.

Design and UX
- New header, footer and homepage: upcoming meetups first, recent
  write-ups, community posts and ways to take part
- Official logo marks from bangpypers/assets, navy and yellow palette,
  Anek Latin and Source Serif 4 type
- Light and dark themes: follows the system setting, with a header
  button that remembers the reader's choice
- Accessible markup: skip link, landmarks, one h1 per page, single-link
  cards, visible focus, reduced motion respected
- Post pages with reading time, author cards, tags and share links;
  blog and archives grouped by year; proper 404 page
- Search in a native dialog, loaded only when opened

Security
- Content-Security-Policy in production builds; no inline scripts or
  event handlers anywhere in the templates
- Fix DOM XSS in search results (rendered with textContent)
- Remove jQuery, Bootstrap, Popper and Font Awesome CDNs
- Google Analytics only in production builds
- SECURITY.md, .well-known/security.txt, robots.txt and sitemap

Build and deploy
- Jekyll 4.4 with all gems updated
- Deploy with GitHub Actions instead of the classic Pages builder, so
  jekyll-archives runs and tag/year pages stop returning 404
- Fix jekyll-archives keys (year/month) that never generated pages
- SHA-pinned actions, least-privilege permissions, Dependabot with a
  7-day cooldown; remove Travis and the token-based deploy script
- check_blogs.rb also guards the CSP, inline scripts, search index,
  structured data, security.txt expiry and theme script loading

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-field replace in structuredata.html was a no-op, so a post title,
description or author name containing "</script>" could end the JSON-LD
script element early and inject HTML. Escape "<" once over the rendered
block instead, which also covers author names and site fields, and add a
check_blogs.rb test that renders the include with hostile values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
@indiVar0508
indiVar0508 merged commit 1f76d88 into master Nov 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant