Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Preview build

# Builds the site with the same builder GitHub Pages uses, so a green
# check here means the live build will succeed. The rendered site is
# uploaded as an artifact for previewing before merge.

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build with Jekyll (GitHub Pages builder)
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site

- name: Upload preview
id: upload
uses: actions/upload-artifact@v4
with:
name: site-preview
path: _site
retention-days: 14

- name: Summary
run: |
echo "### Preview build passed" >> "$GITHUB_STEP_SUMMARY"
echo "Download: ${{ steps.upload.outputs.artifact-url }}" >> "$GITHUB_STEP_SUMMARY"
echo 'Unzip, then `python3 -m http.server -d site-preview`' >> "$GITHUB_STEP_SUMMARY"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ _site/

# Vendored Vale linter styles (fetched via `vale sync`)
.vale-styles/
cv.pdf
cv-print.html
70 changes: 41 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
.PHONY: help serve server build clean install test

BUNDLE := /opt/homebrew/opt/ruby/bin/bundle

help:
@echo "Available commands:"
@echo " make serve - Serve the site locally with live reload"
@echo " make server - Serve the site locally (alias for serve)"
@echo " make build - Build the site for production"
@echo " make clean - Clean build artifacts"
@echo " make install - Install Jekyll dependencies"
@echo " make test - Serve site locally (alias for serve)"

serve:
$(BUNDLE) exec jekyll serve --livereload

server: serve

build:
$(BUNDLE) exec jekyll build

clean:
rm -rf _site .jekyll-cache .jekyll-metadata

install:
gem install jekyll bundler
bundle install

test: serve
.PHONY: help serve server build clean install test pdf

BUNDLE := /opt/homebrew/opt/ruby/bin/bundle
CHROME ?= $(shell command -v google-chrome || command -v chromium || echo "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")

help:
@echo "Available commands:"
@echo " make serve - Serve the site locally with live reload"
@echo " make server - Serve the site locally (alias for serve)"
@echo " make build - Build the site for production"
@echo " make pdf - Render index.md to cv.pdf"
@echo " make clean - Clean build artifacts"
@echo " make install - Install Jekyll dependencies"
@echo " make test - Serve site locally (alias for serve)"

serve:
$(BUNDLE) exec jekyll serve --livereload

server: serve

build:
$(BUNDLE) exec jekyll build

# Needs pandoc and Chrome/Chromium on PATH (override with CHROME=/path/to/chrome)
pdf:
@command -v pandoc >/dev/null || { echo "make pdf needs pandoc: https://pandoc.org/installing.html"; exit 1; }
LC_ALL=C.UTF-8 pandoc index.md -f commonmark_x -s -o cv-print.html --css cv-print.css \
-M title="Craig T. Russell, PhD" \
-M subtitle="$$(sed -n 's/^title: //p' index.md)"
"$(CHROME)" --headless --no-sandbox --disable-gpu --no-pdf-header-footer \
--print-to-pdf=cv.pdf "file://$(CURDIR)/cv-print.html"
rm -f cv-print.html

clean:
rm -rf _site .jekyll-cache .jekyll-metadata cv.pdf cv-print.html

install:
gem install jekyll bundler
bundle install

test: serve
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ exclude:
- Dockerfile
- docker-compose.yml
- docs/
- cv-print.css
- cv-print.html

# Site metadata

Expand Down
20 changes: 20 additions & 0 deletions cv-print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Print styles for cv.pdf (pandoc index.md -> HTML -> Chrome PDF). See `make pdf`. */
@page { size: A4; margin: 10mm 13mm; }
body { font: 8.8pt/1.28 "Helvetica Neue", Arial, sans-serif; color: #111; }
h1 { font-size: 17pt; margin: 0 0 1mm; }
h2 { font-size: 10.5pt; text-transform: uppercase; letter-spacing: .06em;
border-bottom: 1px solid #999; margin: 2.6mm 0 1.2mm; padding-bottom: .6mm; }
p { margin: 0 0 1.2mm; }
ul, ol { margin: 0 0 1.2mm; padding-left: 4mm; }
li { margin: 0 0 .3mm; }
a { color: #0b4f8a; text-decoration: none; }
h2, strong { break-after: avoid; }
li { break-inside: avoid; }
/* undo pandoc's default page styles */
html { background: #fff; }
body { max-width: none; margin: 0; padding: 0; }
header#title-block-header { margin: 0 0 2mm; }
h1.title { font-size: 17pt; margin: 0 0 1mm; text-align: left; }
p.subtitle { font-size: 10.5pt; color: #444; margin: 0; text-align: left; }
/* the site links to the PDF; hide that link inside the PDF */
p:has(> a[href="cv.pdf"]) { display: none; }
Loading
Loading