You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-36Lines changed: 21 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
-
# Pandoc Template for Online Exhibits
1
+
# Overview
2
2
3
-
This is a template repository that allows Caltech Archives & Special Collections to create exhibits hosted on GitHub Pages using Markdown. The template provides a consistent design system aligned with Caltech branding while allowing content creators to focus on writing exhibit content in an accessible, easy-to-use format.
3
+
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.
4
4
5
5
## Technology
6
6
7
-
This template uses a static site generation approach that converts Markdown content into styled HTML pages:
7
+
This template uses a static site generation approach that converts Markdown content into styled HTML pages using a Pandoc template:
8
8
9
9
-**Content Creation**: Exhibit content is written in Markdown (`.md` files), making it easy to write and maintain without HTML knowledge
10
10
-**Pandoc**: A universal document converter that transforms Markdown into HTML using a custom template
11
11
-**Lua Filter**: Custom image processing filter (`figures.lua`) that applies alignment and styling classes to images
12
12
-**YAML Configuration**: Structured configuration for menus and front matter metadata
13
13
-**Front Matter**: YAML metadata at the top of each Markdown file controls page-specific design and settings
14
-
-**Build Script**: Automated bash script (`build.sh`) that processes all content files
14
+
-**Build Script**: Automated bash script (`build.sh`) that processes all content files and outputs them to a `_site/` directory
15
+
-**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
15
16
16
17
## Building Your Menu with YAML
17
18
@@ -94,60 +95,53 @@ Images in Markdown can be styled using Pandoc's attribute syntax. The Lua filter
94
95
95
96
## Building Your Site
96
97
97
-
To generate HTML from your Markdown content:
98
+
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:
98
99
99
100
```bash
100
101
./build.sh
101
102
```
102
103
103
104
This script will:
104
-
1. Clean and recreate the `_site/` directory
105
+
1. Clean and recreate the `_site/` directory (temporary build location)
105
106
2. Copy static assets (CSS and images) to `_site/`
106
107
3. Process all `.md` files in the `content/` directory
107
108
4. Apply the Pandoc template and Lua filters
108
109
5. Generate HTML files in the `_site/` directory
109
110
110
-
All generated files are placed in the `_site/` directory, which is excluded from version control via `.gitignore`. This follows the Jekyll convention for static site generators.
111
+
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).
112
+
111
113
112
114
## Launch and Deployment
113
115
114
116
This template uses a **two-stage publishing workflow**:
115
117
116
-
1. **Staging (GitHub Pages)** - Automatic preview site for reviewing changes
118
+
1. **Preview/staging (GitHub Pages)** - Automatic preview site to review changes before going live.
117
119
2. **Production (S3)** - Manual publish to the live site when ready
118
120
119
-
### Stage 1: Automatic Staging Deployment
120
-
121
-
Every time you push changes to the main branch, the site automatically deploys to GitHub Pages as a preview/staging site.
121
+
### Automated Preview Deployment
122
122
123
-
**Setup:**
123
+
GitHub Pages will be automatically configured the first time you commit a change to the main branch. The workflow will:
124
124
125
-
1. **Enable GitHub Pages** in your repository:
126
-
- Go to **Settings** → **Pages**
127
-
- Under "Source", select **Deploy from a branch**
128
-
- Choose the `gh-pages` branch and `/ (root)` folder
129
-
- Click **Save**
125
+
1. Build your site
126
+
2. Create a `gh-pages` branch (if it doesn't exist)
127
+
3. Deploy your site to GitHub Pages
130
128
131
-
2. **Push your changes** to the main branch - the workflow will automatically:
132
-
- Install Pandoc
133
-
- Run `./build.sh` to generate the `_site/` directory
134
-
- Deploy the `_site/` directory contents to the `gh-pages` branch
135
-
- Publish to GitHub Pages
129
+
After your first commit, wait 1-2 minutes, then visit your preview URL:
0 commit comments