Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/convert-svg-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Convert SVG post images to PNG for social thumbnails

# Runs whenever posts or blog images change. Scans every post's `image:` front
# matter value; if it points to an SVG, a raster PNG copy is generated at the
# same path (same name, .png extension) and committed back to the branch.
# The SVG is left untouched — it continues to be used for page display.
# head.html then swaps .svg → .png only for the og:image / twitter:image tags.

on:
push:
paths:
- "_posts/**"
- "assets/img/blogs/**"

jobs:
convert-svg:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Install rsvg-convert
run: sudo apt-get install -y librsvg2-bin

- name: Convert SVG post images to PNG
id: convert
run: |
set -euo pipefail
converted=0
converted_files=""

# Collect every `image:` value from post front matter
while IFS= read -r line; do
# Strip the key and surrounding quotes, preserving spaces in path
raw="${line#image:}"
raw="$(echo "$raw" | sed "s/^[[:space:]]*//;s/[[:space:]]*$//;s/^[\"']//;s/[\"']$//")"
raw="${raw#/}" # strip leading slash to form a relative path

[[ "$raw" == *.svg ]] || continue

svg="$raw"
png="${svg%.svg}.png"

if [[ ! -f "$svg" ]]; then
echo "⚠️ SVG not found, skipping: $svg"
continue
fi

if [[ -f "$png" ]]; then
echo "✅ PNG already exists, skipping: $png"
continue
fi

echo "🔄 Converting $svg → $png"
# 1200×630 is the recommended og:image size for all major platforms
rsvg-convert --width 1200 --height 630 --keep-aspect-ratio "$svg" -o "$png"
converted_files="$converted_files $png"
converted=$((converted + 1))
done < <(grep -h "^image:" _posts/*.md 2>/dev/null || true)

echo "converted=$converted" >> "$GITHUB_OUTPUT"
echo "converted_files=$converted_files" >> "$GITHUB_OUTPUT"

- name: Commit converted PNGs
if: steps.convert.outputs.converted != '0'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Stage only the files we actually converted (they may live anywhere)
for f in ${{ steps.convert.outputs.converted_files }}; do
git add "$f"
done
git commit -m "chore: add PNG thumbnails converted from SVG post images [skip ci]"
git push
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
source "https://rubygems.org"
gem "jekyll", "~> 4.3"
gem "minima", "~> 2.5"
gem "jekyll-sitemap"
gem "jekyll-sitemap"
gem "jekyll-seo-tag"
gem "jekyll-feed"
17 changes: 17 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@

<head>
{% comment %} Explicit og:image / twitter:image placed before {% seo %} so our tag
takes precedence. Uses the post's image when set, falls back to the site-wide banner.
SVGs are not supported by social crawlers, so for og:image we swap the .svg extension
to .png — a raster copy is auto-generated by .github/workflows/convert-svg-images.yml
and committed alongside the original SVG, leaving it intact for page display. {% endcomment %}
{% if page.image %}
{% assign _page_ext = page.image | split: '.' | last | downcase %}
{% if _page_ext == 'svg' %}
{% assign _og_img = page.image | replace: '.svg', '.png' | absolute_url %}
{% else %}
{% assign _og_img = page.image | absolute_url %}
{% endif %}
{% else %}
{% assign _og_img = site.image | absolute_url %}
{% endif %}
<meta property="og:image" content="{{ _og_img }}">
<meta name="twitter:image" content="{{ _og_img }}">
{% seo %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
2 changes: 1 addition & 1 deletion _posts/2025-07-13-eval-science-kickoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "The Science of Evaluations: Workstream Kickoff Post"
date: 2025-07-13
category: Research
published: true
image: assets/img/blogs/eval-sci-kickoff.webp
image: /assets/img/blogs/eval-sci-kickoff.webp
authors:
- name: "Eval Science working group, led by Subho Majumdar"
url: "https://shubhobm.github.io/"
Expand Down
2 changes: 1 addition & 1 deletion _posts/2025-08-10-blog-chart-crisis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "The AI Evaluation Chart Crisis"
date: 2025-08-09
published: true
category: Documentation
image: "assets/img/blogs/2-data-chart.webp"
image: "/assets/img/blogs/2-data-chart.webp"
authors:
- name: "Andrew Tran"
- name: "Leshem Choshen"
Expand Down
2 changes: 1 addition & 1 deletion _posts/2025-11-12-hidden-cost-of-evals.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "The Hidden Social Costs of AI"
date: 2025-11-12
published: true
category: Research
image: assets/img/blogs/simp_eval_timeline.png
image: /assets/img/blogs/simp_eval_timeline.png
authors:
- name: "Abdul Hameed"
- name: "Afifah Kashif"
Expand Down
Binary file added assets/img/blogs/field-notes-interview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.