CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a personal academic website for Pingfan Hu, built with Quarto (a scientific publishing system). The site is deployed to pingfanhu.com and uses R for dynamic content generation.
Build Commands
# Preview site locally (live reload)
quarto preview
# Build the full site
quarto render
# Render a single file
quarto render about.qmdThe rendered output goes to _site/. CV and Resume are rendered as PDF via a custom cv-pdf format defined in _extensions/.
Architecture
Site Configuration
_quarto.yml— master config: navbar, theme, CSS, global R chunk options, resource paths_variables.yml— reusable shortcodes likeandAlfred P. Sloan Foundationused site-widestyles/styles.cssandstyles/theme.scss— custom styling on top of theunitedBootstrap theme, background#F8F7F0
Content Sections
index.qmd— homepage (trestles layout)about.qmd,blog.qmd,projects.qmd,papers.qmd,talks.qmd— top-level pagescv.qmd/resume.qmd— rendered as PDF usingformat: cv-pdf
Reusable Chunks (chunks/)
Partial .qmd files included via {{< include /chunks/filename.qmd >}}: - intro.qmd, skills.qmd — used in both index.qmd and about.qmd - 2025-plosone-surveydown.qmd, 2025-erl-smart-charging.qmd, etc. — paper citation blocks reused across papers.qmd and project pages
Content Collections
blog/— individual blog posts, each in their own subdirectory with anindex.qmd. Listing auto-generated byblog.qmd.projects/— research project pages, same pattern. Listing auto-generated byprojects.qmdas a grid.talks/talks.csv— data-driven talks listing.talks.qmdreads this CSV with R (tidyverse,htmltools) and generates HTML cards. Adding a new talk = adding a row to the CSV. Each slide talk links tohttps://pingfan-hu.github.io/{Name}/and a PDF at/talks/{Name}.pdf.
Password Protection
blog.qmd contains a client-side password protection mechanism via styles/auth.js. Protected files are listed in protected_files in blog.qmd. A .env file with SITE_PASSWORD is read at render time; without it, defaults to "defaultpass".
Extensions (_extensions/)
cv/— custom LaTeX format for PDF CV generationquarto-ext/— additional Quarto extensions (e.g., fontawesome icons used as)
Key Conventions
- Project pages: Each project lives in
projects/{year}-{slug}/index.qmd. Front matter includestitle,image,author,date,categories, anddescription. - Blog posts: Same pattern in
blog/{date}-{slug}/index.qmd._metadata.ymlinblog/setsauthor: "Pingfan Hu"globally for all posts. - Banners: Project/blog banner images live in
projects/banners/andblog/banners/(referenced in listing configs). - External links:
link-external-newwindow: trueis global; internal links are filtered bypingfanhu.comdomain. {{< include >}}paths are always absolute from project root (e.g.,/chunks/intro.qmd).