Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
16dc2d7
ADD: member faces on news and publications, linked to member pages
cosmos1030 Oct 22, 2026
54ae75c
REFACTOR: move content into data/ databases rendered by tools/build.py
dongyeoplee2 Oct 22, 2026
9fbeb5f
REFACTOR: share the page frame through templates/base.html
dongyeoplee2 Oct 22, 2026
0290000
ADD: per-database READMEs, deploy workflow, hook and docs for the dat…
dongyeoplee2 Oct 22, 2026
cd1de40
REFACTOR: publications as one papers.bib; people by @tag; faces rende…
dongyeoplee2 Oct 22, 2026
1a0b574
REFACTOR: news links to papers by BibTeX key: [paper](shin23closer)
dongyeoplee2 Oct 22, 2026
1eb8db6
REFACTOR: news as one YAML file per year with explicit idx; field tem…
dongyeoplee2 Oct 22, 2026
5f14030
REFACTOR: paper keys are written with @ in news: [paper](@shin23close…
dongyeoplee2 Oct 22, 2026
cfc5fd0
REFACTOR: rename templates/ to pages/
dongyeoplee2 Oct 22, 2026
8969532
REFACTOR: news items keyed by idx (16: date/text) instead of a list
dongyeoplee2 Oct 22, 2026
e55b966
REFACTOR: gallery photos keyed by idx (46: file/caption), highest first
dongyeoplee2 Oct 22, 2026
e067287
STYLE: short inline comments and spacing in config.toml files
dongyeoplee2 Oct 22, 2026
1c9deab
REFACTOR: members keyed by tag (namhoonlee: name/photo/...)
dongyeoplee2 Oct 22, 2026
c8476c9
REFACTOR: rename pages/ to layout/
dongyeoplee2 Oct 22, 2026
9c23581
REFACTOR: remove committed gallery thumbnails; the build generates them
dongyeoplee2 Oct 22, 2026
6bc6a30
REFACTOR: research page content back in layout/research.html; icons i…
dongyeoplee2 Oct 22, 2026
807d29d
ADD: list every link field used in papers.bib in its header template
dongyeoplee2 Oct 22, 2026
834b88a
REFACTOR: text pages in content/, wrapped by one layout/page.html
dongyeoplee2 Oct 22, 2026
68feaba
STYLE: reformat content/research.html and contact.html for reading
dongyeoplee2 Oct 22, 2026
d92d88b
STYLE: remove leftover indent from content/hiring.html
dongyeoplee2 Oct 22, 2026
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
79 changes: 27 additions & 52 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
#!/usr/bin/env bash
#
# Optimize any image being committed, and generate its gallery thumbnail.
# Check data/ and optimize any image being committed.
#
# Enable with: tools/setup-hooks.sh
# Bypass once: git commit --no-verify
#
# Photos are resized, re-encoded and stripped of EXIF before they enter git
# history, so the repository never stores a 10MB camera original. Rules live in
# tools/optimize-images.sh.
# 1. tools/build.py --check validates every database in data/ (file names,
# required fields, missing photos), so a broken entry never reaches main.
# 2. Photos are resized, re-encoded and stripped of EXIF before they enter git
# history, so the repository never stores a 10MB camera original. Rules live
# in tools/optimize-images.sh. Gallery thumbnails are made by the build and
# are not committed.
#
# Written for the bash 3.2 that ships with macOS.

set -euo pipefail

REPO="$(git rev-parse --show-toplevel)"
cd "$REPO"

# news.html is the source of truth for Recent News on the home page. If it is
# being committed, regenerate the home page's copy so links added on the News
# page never go missing there.
if git diff --cached --name-only --diff-filter=ACMR | grep -qx 'news.html'; then
if tools/sync-home-news.py >/dev/null; then
if ! git diff --quiet -- index.html; then
git add -- index.html
echo "pre-commit: synced Recent News on index.html from news.html"
fi
else
echo "pre-commit: tools/sync-home-news.py failed; commit anyway with --no-verify" >&2
exit 1
fi
if ! python3 tools/build.py --check >/dev/null; then
python3 tools/build.py --check || true
echo "pre-commit: fix the data errors above, or commit anyway with --no-verify" >&2
exit 1
fi

# Staged images in the directories the optimizer manages.
mapfile -t STAGED < <(
STAGED=()
while IFS= read -r path; do
STAGED+=("$path")
done < <(
git diff --cached --name-only --diff-filter=ACMR \
| grep -Ei '^(stories|lab_photo|group_profile|research_focus)/.*\.(jpe?g|png)$' || true
| grep -Ei '^(data/gallery/photos|data/members/photos|static/research_focus|static/lab_photo)/.*\.(jpe?g|png)$' || true
)

[ "${#STAGED[@]}" -gt 0 ] || exit 0
Expand All @@ -52,12 +51,10 @@ EOF
exit 1
fi

# Remember the HTML files' state so we can stage only the ones the optimizer
# actually rewrites (when a file changes extension).
declare -A HTML_BEFORE
for page in *.html; do
[ -f "$page" ] && HTML_BEFORE["$page"]="$(git hash-object "$page")"
done
# Files that name images. Remember their state so we stage only the ones the
# optimizer rewrites (when an image changes extension), not unrelated edits.
REFS="data/gallery/gallery.yaml data/members/members.yaml layout/index.html content/research.html"
BEFORE="$(for f in $REFS; do [ -f "$f" ] && echo "$f $(git hash-object "$f")"; done)"

echo "pre-commit: optimizing ${#STAGED[@]} image(s)..."
tools/optimize-images.sh "${STAGED[@]}"
Expand All @@ -75,32 +72,10 @@ for path in "${STAGED[@]}"; do
fi
done

# A new photo in stories/ needs its gallery thumbnail generated and staged.
for path in "${STAGED[@]}"; do
case "$path" in
stories/thumbs/*) continue ;;
stories/*) ;;
*) continue ;;
esac
base="$(basename "${path%.*}")"
thumb="stories/thumbs/${base}.jpg"
if [ ! -f "$thumb" ]; then
source_file="$path"
[ -f "$source_file" ] || source_file="${path%.*}.jpg"
convert "$source_file" -auto-orient -resize "600x600^" -gravity center \
-extent 600x600 -strip -interlace Plane -sampling-factor 4:2:0 \
-quality 80 -set comment "log-opt-v1" "$thumb"
chmod 644 "$thumb"
echo " generated thumbnail $thumb"
fi
git add -- "$thumb"
done

# Stage HTML only where a path reference was rewritten.
for page in "${!HTML_BEFORE[@]}"; do
[ -f "$page" ] || continue
if [ "$(git hash-object "$page")" != "${HTML_BEFORE[$page]}" ]; then
git add -- "$page"
echo " staged rewritten references in $page"
for f in $REFS; do
[ -f "$f" ] || continue
if [ "$(echo "$BEFORE" | awk -v f="$f" '$1 == f { print $2 }')" != "$(git hash-object "$f")" ]; then
git add -- "$f"
echo " staged rewritten references in $f"
fi
done
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Build the site from data/ + layout/ and publish it to GitHub Pages.
#
# Requires Settings -> Pages -> Build and deployment -> Source: "GitHub Actions".
# Pull requests are built (so broken data fails the check) but not deployed.
name: Build and deploy

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Never let two deployments race for the Pages environment.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y -q imagemagick
pip install -r requirements.txt

- name: Build
run: python tools/build.py

- uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_site/
__pycache__/
.DS_Store
Loading
Loading