diff --git a/.github/workflows/convert-svg-images.yml b/.github/workflows/convert-svg-images.yml new file mode 100644 index 0000000..eb22579 --- /dev/null +++ b/.github/workflows/convert-svg-images.yml @@ -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 diff --git a/Gemfile b/Gemfile index 4195c36..1790ac5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ source "https://rubygems.org" gem "jekyll", "~> 4.3" gem "minima", "~> 2.5" -gem "jekyll-sitemap" \ No newline at end of file +gem "jekyll-sitemap" +gem "jekyll-seo-tag" +gem "jekyll-feed" \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 52efc04..c048c19 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,5 +1,22 @@
+ {% 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 %} + + {% seo %} diff --git a/_posts/2025-07-13-eval-science-kickoff.md b/_posts/2025-07-13-eval-science-kickoff.md index f62eb42..e383310 100644 --- a/_posts/2025-07-13-eval-science-kickoff.md +++ b/_posts/2025-07-13-eval-science-kickoff.md @@ -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/" diff --git a/_posts/2025-08-10-blog-chart-crisis.md b/_posts/2025-08-10-blog-chart-crisis.md index 8426911..7f4302b 100644 --- a/_posts/2025-08-10-blog-chart-crisis.md +++ b/_posts/2025-08-10-blog-chart-crisis.md @@ -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" diff --git a/_posts/2025-11-12-hidden-cost-of-evals.md b/_posts/2025-11-12-hidden-cost-of-evals.md index bdf5b6e..c257754 100644 --- a/_posts/2025-11-12-hidden-cost-of-evals.md +++ b/_posts/2025-11-12-hidden-cost-of-evals.md @@ -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" diff --git a/assets/img/blogs/field-notes-interview.png b/assets/img/blogs/field-notes-interview.png new file mode 100644 index 0000000..8ac35c7 Binary files /dev/null and b/assets/img/blogs/field-notes-interview.png differ