Kyle Cranmer's personal website, built with Pelican.
Live site: https://theoryandpractice.org
This repository is a fresh migration of the original TheoryAndPractice repository, which used Pelican 3.7.1. The migration was performed in December 2025 to modernize the site infrastructure.
- Pelican version: 3.7.1 → 4.11.0
- Environment management: Now uses pixi for reproducible environments
- Plugin system: Migrated to Pelican 4's namespace plugin architecture where possible
- Deployment: GitHub Actions workflow deploys to cranmer/cranmer.github.io
- All existing content and URL structure
- pelican-bootstrap3 theme with Bootswatch 'flatly' styling
- Custom per-page JavaScript and CSS functionality
- Jupyter notebook embedding via liquid tags
- BibTeX bibliography support
Install pixi:
curl -fsSL https://pixi.sh/install.sh | bash# Build the site
pixi run build
# Serve locally with auto-rebuild
pixi run serve
# Clean output directory
pixi run clean
# Build for production
pixi run publish
# Update citation counts from OpenAlex/Semantic Scholar
pixi run update-citationsThe local server runs at http://localhost:8000
The site is deployed automatically via GitHub Actions when pushing to the main branch.
- Push to
maintriggers.github/workflows/deploy.yml - GitHub Actions builds the site using
publishconf.py - Output is pushed to the
cranmer/cranmer.github.iorepository - GitHub Pages serves the site at theoryandpractice.org
The workflow uses a deploy key to push to the external repository:
- Generate an SSH key pair
- Add the public key as a deploy key (with write access) to
cranmer/cranmer.github.io - Add the private key as a secret named
DEPLOY_KEYto this repository
These are installed from PyPI and auto-discovered by Pelican:
| Plugin | Purpose |
|---|---|
pelican-render-math |
LaTeX math rendering |
pelican-liquid-tags |
Liquid template tags (notebook embedding, etc.) |
pelican-i18n-subsites |
Internationalization support |
pelican-neighbors |
Next/previous article navigation |
pelican-sitemap |
XML sitemap generation |
pelican-jupyter |
Jupyter notebook support |
pelican-presentations |
Presentations page from YAML data |
The site uses Pagefind for fast, client-side search:
- Indexes all pages at build time
- Instant search with no server required
- Search icon in navbar links to
/search.html
Pagefind runs automatically after Pelican builds (configured in pyproject.toml).
These are custom or modified plugins maintained locally:
Allows per-article/page custom JavaScript and CSS via metadata:
JavaScripts: custom.js, https://example.com/lib.js
Stylesheets: custom.cssInline BibTeX citations with [@citation-key] syntax. Generates a bibliography section at the end of articles.
Modifications made:
- Added Bootstrap modal popup for viewing BibTeX entries
- Added "Copy to Clipboard" functionality
- BibTeX entries display with proper formatting
Generates a publications page from a BibTeX file.
Modifications made:
- Bootstrap modal for BibTeX display (replacing broken popup windows)
- Copy to clipboard functionality
- Handles missing
journalandbooktitlefields gracefully
The site uses pelican-bootstrap3 with the Bootswatch 'flatly' theme.
- Added
extra_stylesheetsblock for per-page CSS - Added per-page JavaScript support in article/page templates
- Added Bluesky social icon (custom CSS with SVG, since Font Awesome 4.x lacks it)
- Added
publications.htmltemplate for bibliography page - Added
presentations.htmltemplate for talks/presentations page with video icons
A custom plugin (in plugins/pelican-selected-publications) that generates a curated publications page organized by research themes. See the plugin README for full documentation.
Features:
- YAML-driven category organization with BibTeX keys
- Filter by category, year, and highlighted papers
- Sort by category, date, or citation count
- Publication metrics display (total papers, citations, h-index)
- Profile icons linking to Google Scholar, INSPIRE, arXiv, OpenAlex, ORCiD
- Citation counts fetched from OpenAlex (with Semantic Scholar fallback)
- Collapsible Altmetric badges for each publication
- BibTeX modal with copy-to-clipboard
Configuration:
SELECTED_PUBLICATIONS_SRC = 'content/selected-publications.yml'
# Aggregate metrics (displayed in two boxes)
ALL_PUBLICATION_METRICS = {
'total_publications': 1200,
'total_citations': 349000,
'h_index': 241,
}
SMALL_AUTHOR_METRICS = {
'total_publications': 119,
'total_citations': 14000,
'h_index': 41,
}
PUBLICATION_PROFILES = (
('Google Scholar', 'http://scholar.google.com/...', 'google-scholar'),
('INSPIRE', 'https://inspirehep.net/...', 'inspire'),
...
)Updating Citation Counts:
pixi run update-citationsThis fetches citation counts from OpenAlex (with Semantic Scholar as fallback) and saves them to content/citations.json. Manual overrides can be added to content/citations-manual.json.
A custom plugin (in plugins/pelican-collaborators) that generates a collaborators/team page with photos organized by category. See the plugin README for full documentation.
Features:
- YAML-driven configuration (
content/collaborators.yml) - Category grouping (students, postdocs, scientists, collaborators)
- Current/Former filtering with JavaScript toggle
- Auto-fetch avatars from GitHub and Bluesky
- Rich metadata (roles, affiliations, thesis info, current positions)
- Automatic sorting (active first, then by year)
Configuration:
COLLABORATORS_SRC = 'content/collaborators.yml'
DIRECT_TEMPLATES = [..., 'collaborators']Helper Scripts:
# Update start_year/end_year from co-authored publications
pixi run update-collaborator-years
# Preview changes without modifying
pixi run update-collaborator-years --dry-runThe script searches OpenAlex and INSPIRE to find co-authored papers and automatically sets collaboration date ranges.
A custom plugin (in plugins/pelican-projects) that generates a projects page with card-based layout organized by category. See the plugin README for full documentation.
Features:
- YAML-driven configuration (
content/projects.yml) - Category grouping (software, research, methodology, community, etc.)
- Card and list view toggle
- Status filtering (All / Active / Completed)
- Draft mode with separate preview page (
/projects-draft.html) - Auto-fetch images from GitHub repos
- SVG images get white background automatically
- Featured projects highlighted with star badge
Configuration:
PROJECTS_SRC = 'content/projects.yml'
DIRECT_TEMPLATES = [..., 'projects', 'projects-draft']Usage:
/projects.html- Main projects page (in navigation), shows only published projects/projects-draft.html- Preview page (not in navigation), shows all projects including drafts
A custom plugin (in plugins/pelican-media) that generates a media & outreach page with embedded videos, podcasts, articles, and interviews. See the plugin README for full documentation.
Features:
- YAML-driven configuration (
content/media.yml) - Category grouping (videos, podcasts, articles, interviews, outreach)
- Card and list view toggle
- Category and year filtering
- Embedded YouTube/Vimeo videos
- Featured items highlighted
- Helper script to search for new media mentions
Configuration:
MEDIA_SRC = 'content/media.yml'
DIRECT_TEMPLATES = [..., 'media']Helper Script:
# Search Google News for new media mentions
pixi run search-media
# With options
python scripts/search_media.py --days 60 --output suggestions.ymlA custom plugin (in separate repository ../pelican-presentations) that generates a presentations page from YAML data, compatible with the IRIS-HEP presentations format.
Features:
- Parses YAML files with presentation data (title, date, meeting, location, URL, video)
- Groups presentations by year
- Shows video camera icon for presentations with recordings
- Supports both single file (
PRESENTATIONS_SRC) and multiple files (PRESENTATIONS_YAML_FILES)
Configuration:
PRESENTATIONS_SRC = 'content/presentations.yml'
DIRECT_TEMPLATES = [..., 'presentations']pelicanconf.py- Development configurationpublishconf.py- Production configuration (extends pelicanconf.py)
| Setting | Value | Purpose |
|---|---|---|
SITEURL |
https://theoryandpractice.org |
Production URL |
THEME |
themes/pelican-bootstrap3 |
Bootstrap 3 theme |
BOOTSTRAP_THEME |
flatly |
Bootswatch theme variant |
CC_LICENSE |
CC-BY-NC |
Creative Commons license |
PUBLICATIONS_SRC |
content/kyle-20authors.bib |
BibTeX file for publications |
PRESENTATIONS_SRC |
content/presentations.yml |
YAML file for presentations |
content/
├── pages/ # Static pages (Home, Research, Projects, etc.)
├── images/ # Image assets
├── css/ # Custom stylesheets
├── js/ # Custom JavaScript
├── downloads/ # Downloadable files and notebooks
└── *.md # Blog posts
Content is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).