Archives Exhibit Builder is a template repository that enables Caltech Archives & Special Collections to create standalone online exhibits. The system allows the archives team to develop content in Markdown and host relevant images. When changes are committed to the main branch, the site automatically rebuilds and deploys to GitHub Pages as a preview. Once the exhibit is ready, a manual GitHub Action publishes the static files to S3, where the live site is hosted at a branded Caltech Library URL. The template provides a consistent design that aligns with the Caltech Library Design System while allowing content creators to focus on writing exhibit content in an accessible, easy-to-use format.
This template uses a static site generation approach that converts Markdown content into styled HTML pages using a Pandoc template:
- Content Creation: Exhibit content is written in Markdown (
.mdfiles), making it easy to write and maintain without HTML knowledge - Pandoc: A universal document converter that transforms Markdown into HTML using a custom template
- Lua Filter: Custom image processing filter (
figures.lua) that applies alignment and styling classes to images - YAML Configuration: Structured configuration for menus and front matter metadata
- Front Matter: YAML metadata at the top of each Markdown file controls page-specific design and settings
- Build Script: Automated bash script (
build.sh) that processes all content files and outputs them to a_site/directory - GitHub Actions: Two workflows manage deployment:
Preview Changes (automated)automatically deploys to GitHub Pages for preview,Publish Site (Manual)manually publishes to S3 for production
The site navigation menu is configured in config/menu.yaml. Each menu item requires two fields:
menu:
- title: "Home"
url: "index.html"
- title: "About"
url: "about.html"
- title: "Contact"
url: "contact.html"- title: Display text shown in the navigation menu
- url: Relative path to the page (typically the
.htmlfilename)
Each Markdown content file begins with YAML front matter enclosed by --- delimiters. This metadata controls the page's appearance and configuration:
---
exhibit_title: "Title of the Exhibit"
exhibit_subtitle: "Subtitle of the Exhibit"
organization: "Caltech Archives & Special Collections"
feature_image: "feature.webp"
feature_color: "#000000"
feature_overlay: "#001F3F80"
---| Field | Required | Description |
|---|---|---|
exhibit_title |
Yes | Main heading displayed in the banner |
exhibit_subtitle |
No | Secondary heading displayed below the title |
organization |
Yes | Organization name (typically "Caltech Archives & Special Collections") |
feature_image |
No | Filename of the banner background image (stored in /images/) |
feature_color |
No | Hex color code for banner background (e.g., #000000) |
feature_overlay |
No | Hex color code with transparency for overlay effect (e.g., #001F3F80) |
Images in Markdown can be styled using Pandoc's attribute syntax. The Lua filter processes these attributes and applies them to the generated HTML.
{.class1 .class2}.left- Floats image to the left with text wrapping around the right.right- Floats image to the right with text wrapping around the left.center- Centers the image as a block element with no text wrapping
.img-small- Maximum width of 300px.img-medium- Maximum width of 600px.img-large- Maximum width of 100% (full width)
.frame- Adds a border and subtle shadow for a framed appearance
{.img-medium .frame .left}
{.img-large .center}
{.img-small .frame .right}The build process is handled automatically by GitHub Actions. You don't need to run the build script manually. It will run everytime a commit is made to the main branch. However, if you want to build locally for testing you can run:
./build.shThis script will:
- Clean and recreate the
_site/directory (temporary build location) - Copy static assets (CSS and images) to
_site/ - Process all
.mdfiles in thecontent/directory - Apply the Pandoc template and Lua filters
- Generate HTML files in the
_site/directory
The _site/ directory is temporary and excluded from version control via .gitignore. GitHub Actions uses this directory to deploy files to the gh-pages branch (for preview) or S3 (for production).
This template uses a two-stage publishing workflow:
- Preview/staging (GitHub Pages) - Automatic preview site to review changes before going live.
- Production (S3) - Manual publish to the live site when ready
GitHub Pages will be automatically configured the first time you commit a change to the main branch. The workflow will:
- Build your site
- Create a
gh-pagesbranch (if it doesn't exist) - Deploy your site to GitHub Pages
After your first commit, wait 1-2 minutes, then visit your preview URL:
https://caltechlibrary.github.io/your-repo-name/
(Replace your-repo-name with your actual repository name)
When you're ready to publish your exhibit to the live production site, manually trigger the S3 publish workflow.
How to Publish:
- Go to the Actions tab in your repository
- Click on Publish Site (Manual) in the left sidebar
- Click the "Run workflow" button
- Click "Run workflow" to confirm (main branch should be selected)
The workflow will:
- Sync the
gh-pagesbranch to S3 - Create a CloudFront invalidation to update the CDN
- Display the live site URL
Your exhibit will be live at:
https://digital.archives.caltech.edu/exhibits/[repository-name]/
The repository name becomes the URL slug for your exhibit (e.g., repository becoming-caltech → /exhibits/becoming-caltech/).