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.qmd

The 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 like and Alfred P. Sloan Foundation used site-wide
  • styles/styles.css and styles/theme.scss — custom styling on top of the united Bootstrap theme, background #F8F7F0

Content Sections

  • index.qmd — homepage (trestles layout)
  • about.qmd, blog.qmd, projects.qmd, papers.qmd, talks.qmd — top-level pages
  • cv.qmd / resume.qmd — rendered as PDF using format: 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 an index.qmd. Listing auto-generated by blog.qmd.
  • projects/ — research project pages, same pattern. Listing auto-generated by projects.qmd as a grid.
  • talks/talks.csv — data-driven talks listing. talks.qmd reads this CSV with R (tidyverse, htmltools) and generates HTML cards. Adding a new talk = adding a row to the CSV. Each slide talk links to https://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 generation
  • quarto-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 includes title, image, author, date, categories, and description.
  • Blog posts: Same pattern in blog/{date}-{slug}/index.qmd. _metadata.yml in blog/ sets author: "Pingfan Hu" globally for all posts.
  • Banners: Project/blog banner images live in projects/banners/ and blog/banners/ (referenced in listing configs).
  • External links: link-external-newwindow: true is global; internal links are filtered by pingfanhu.com domain.
  • {{< include >}} paths are always absolute from project root (e.g., /chunks/intro.qmd).