CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a Jekyll-based academic personal homepage for Ziyang Guo (郭子扬), forked from RayeRen/acad-homepage.github.io (the “AcadHomepage” template) and migrated to the RerankerGuo GitHub account. The site is hosted at https://RerankerGuo.github.io.
The site has two distinguishing features beyond a vanilla Jekyll template:
- Auto-refreshing Google Scholar citations via a Python crawler + GitHub Action.
- Per-paper citation counts rendered client-side from a JSON file on a separate branch.
Local Development
bash run_server.sh # runs `bundle exec jekyll liveserve` → http://127.0.0.1:4000
Requires Ruby + Bundler. First run: bundle install. The _config.yml is not auto-reloaded by jekyll serve — restart the server after editing it.
_site/ is the build output and is gitignored.
Architecture
Content vs. layout separation
| Layer | Location | Edit when… |
|---|---|---|
| Site-wide config | _config.yml |
Author info, repo URL, analytics IDs, plugins, SEO verifications |
| Single-page content | _pages/about.md |
Anything a visitor reads (bio, news, projects, awards) |
| Sidebar nav links | _data/navigation.yml |
Adding/removing top-nav anchors |
| Styling | _sass/*.scss (compiled into _sass/_base.scss etc.) |
Visual changes — _sidebar.scss is the most recently customized file |
| Page chrome | _layouts/default.html + _includes/*.html |
Header, sidebar, scripts, SEO meta |
_config.yml sets defaults so every page under _pages/ gets layout: default and author_profile: true automatically.
Google Scholar citation pipeline (the non-Jekyll half)
Two independent pieces run on different schedules and live in different branches:
google_scholar_crawler/main.py— Python script usingscholarly+jsonpickle. ReadsGOOGLE_SCHOLAR_IDenv var, fetches the author profile, and writes two JSON files toresults/:gs_data.json— full profile incl. publications keyed byauthor_pub_idgs_data_shieldsio.json—{ "schemaVersion": 1, "label": "citations", "message": "<citedby>" }for shield-style badges
.github/workflows/google_scholar_crawler.yaml— runs onpage_buildand daily at08:00 UTC. Executesmain.py, then force-pushesresults/*.jsonto thegoogle-scholar-statsbranch (note: this is a branch, not a folder inmain). The script exits 0 silently whenGOOGLE_SCHOLAR_IDis unset, so missing-secret builds don’t fail.
Citation rendering on the page
The frontend never blocks on the citation JSON:
_config.ymltogglesgoogle_scholar_stats_use_cdn(defaulttrue) — when on, the page reads fromcdn.jsdelivr.net/gh/{repository}@google-scholar-stats/...instead ofraw.githubusercontent.com._includes/fetch_google_scholar_stats.html(loaded via_layouts/default.html) does the$.getJSONand writes the total into#total_cit.- To show a per-paper citation count, drop
<span class='show_paper_citations' data='AUTHOR_PUB_ID'></span>into_pages/about.md. TheAUTHOR_PUB_IDis the value ofcitation_for_view=...from the paper’s Google Scholar URL.
Fork-specific deviations from upstream AcadHomepage
site.repositoryin_config.ymlisRerankerGuo/RerankerGuo.github.io— must stay in sync with the actual GitHub repo name or the CDN citation URLs 404._config.ymladds thehawkinsgem alongside the standard Jekyll plugins._sass/_sidebar.scsswas restyled locally (see commit5afbafd).google_scholar_crawler/main.pywas patched (commit042bece) to skip cleanly when the secret is absent rather than crashing.- Sidebar profile (
_includes/author-profile.html) and SEO include (_includes/seo.html) have minor local tweaks.
Common Tasks
Update author info or social links → _config.yml under author:.
Edit page content → _pages/about.md (single page; permalink: /).
Add a nav anchor → _data/navigation.yml, then put a matching <span class='anchor' id='anchor-id'></span> in _pages/about.md.
Change a color/layout detail → _sass/_variables.scss first (defines palette), then specific partials.
Refresh citations manually → push a commit to main (triggers page_build); or wait for the 08:00 UTC cron. Verify the JSON landed on the google-scholar-stats branch.
Set up citations on a fresh fork → add the GOOGLE_SCHOLAR_ID repo secret and enable Actions.
Things to avoid
- Don’t commit
_site/— gitignored. - Don’t edit
Gemfile.lockby hand;bundle update <gem>to modify. - The
google-scholar-statsbranch is overwritten by the workflow on every run — don’t base feature branches on it. compress_htmlis configured to skip compression indevelopmentenv only, so production HTML is minified.