Skip to content

Commit 93bfa18

Browse files
committed
feat: add automated testing, validation tools, and contributor docs
1 parent ef57a0a commit 93bfa18

17 files changed

Lines changed: 1101 additions & 14 deletions

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master ]
6+
push:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Setup Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: '3.1'
20+
bundler-cache: true
21+
22+
- name: Build Jekyll site
23+
run: bundle exec jekyll build
24+
env:
25+
JEKYLL_ENV: production
26+
27+
- name: Test with html-proofer
28+
run: |
29+
bundle exec htmlproofer ./_site \
30+
--disable-external \
31+
--ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" \
32+
--allow-hash-href
33+

.gitignore

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# Include your project-specific ignores in this file
2+
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3+
# Useful .gitignore templates: https://github.com/github/gitignore
4+
5+
# Node.js
6+
node_modules
7+
dist
8+
.cache
9+
10+
# Jekyll
111
_site/
12+
.sass-cache/
13+
.jekyll-cache/
14+
.jekyll-metadata
15+
16+
# Ruby
17+
.bundle/
18+
vendor/bundle/
19+
*.gem
20+
21+
# OS
222
.DS_Store
3-
Gemfile.lock
23+
Thumbs.db
24+
25+
# Editor
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
*~

.ruby-version

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
3.1.0
2+

CONTRIBUTING.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# Contributing to Deep-MI Website
2+
3+
Thank you for contributing to the Deep-MI lab website! This guide will help you add content correctly.
4+
5+
## Table of Contents
6+
7+
- [Creating News Posts](#creating-news-posts)
8+
- [Adding Members](#adding-members)
9+
- [Adding Publications](#adding-publications)
10+
- [Validation Before Committing](#validation-before-committing)
11+
- [Local Development](#local-development)
12+
13+
## Creating News Posts
14+
15+
1. **Create a new file** in `_posts/` directory
16+
2. **Name it**: `YYYY-MM-DD-Short-Title.md` (e.g., `2026-02-13-New-Grant.md`)
17+
3. **Use the template** from `_templates/post-template.md`
18+
19+
### Required Front Matter
20+
21+
```yaml
22+
---
23+
title: Your Article Title
24+
author: First Lastname
25+
layout: post
26+
group: news
27+
---
28+
```
29+
30+
### Tips
31+
32+
- Use Markdown for formatting
33+
- Include images in `/static/img/` directory
34+
- Keep image file sizes reasonable (< 500KB)
35+
36+
## Adding Members
37+
38+
1. **Add member info** to `_data/members.yml`
39+
2. **Prepare photo**: 365×365 pixels, 72 DPI, JPEG format
40+
3. **Save photo** to `/static/img/members/lastname.jpg`
41+
4. **Use the template** from `_templates/member-template.md`
42+
43+
### Required Fields
44+
45+
- `name`: Full name
46+
- `image`: Path to photo (e.g., `/static/img/members/lastname.jpg`)
47+
- `position`: Job title
48+
49+
### Optional Fields
50+
51+
- `email`: Email address
52+
- `scholar`: Google Scholar ID
53+
- `twitter`: Twitter handle
54+
- `orcid`: ORCID identifier
55+
- `github`: GitHub username
56+
- `description`: Biography (use single quotes for multi-line)
57+
58+
## Adding Publications
59+
60+
1. **Add publication info** to `_data/publications.yml`
61+
2. **Prepare teaser image**: Max 200px height, JPEG, max 100KB
62+
3. **Save files**:
63+
- Image: `/static/pub/paper_id.jpg`
64+
- BibTeX: `/static/pub/paper_id.bib`
65+
- PDF (optional): `/static/pub/paper_id.pdf`
66+
4. **Use the template** from `_templates/publication-template.md`
67+
68+
### Required Fields
69+
70+
- `id`: Unique identifier (usually `lastname_year`)
71+
- `authors`: Author list (bold lab members: `**Name**`)
72+
- `title`: Paper title
73+
- `journal`: Journal/conference name
74+
- `type`: One of: journal, conference, workshop, abstract, poster, preprint
75+
- `year`: Publication year
76+
77+
### Recommended Fields
78+
79+
- `doi`: Digital Object Identifier
80+
- `image`: Teaser image path
81+
- `bibtex`: BibTeX file path
82+
- `pdf`: Link to open access PDF or local file
83+
84+
## Validation Before Committing
85+
86+
Always validate your changes before committing:
87+
88+
```bash
89+
# Validate YAML files
90+
./scripts/validate_yaml.rb
91+
92+
# Validate post filenames and format
93+
./scripts/validate_posts.sh
94+
95+
# Test the site locally
96+
bundle exec jekyll serve
97+
```
98+
99+
Visit http://localhost:4000 to preview your changes.
100+
101+
## Automation Tools
102+
103+
### Image Optimization
104+
105+
Optimize images to meet size requirements:
106+
107+
```bash
108+
# Optimize a single member photo (365x365, 72 DPI)
109+
./scripts/optimize_images.sh member static/img/members/lastname.jpg
110+
111+
# Optimize a single publication teaser (max 200px height, max 100KB)
112+
./scripts/optimize_images.sh pub static/pub/paper_id.jpg
113+
114+
# Optimize all member photos at once
115+
./scripts/optimize_images.sh all-members
116+
117+
# Optimize all publication teasers at once
118+
./scripts/optimize_images.sh all-pubs
119+
```
120+
121+
**Requirements**: ImageMagick (`brew install imagemagick`)
122+
123+
### Pre-commit Hook
124+
125+
Install a pre-commit hook to automatically validate changes:
126+
127+
```bash
128+
cp scripts/pre-commit.sh .git/hooks/pre-commit
129+
chmod +x .git/hooks/pre-commit
130+
```
131+
132+
This will automatically run validation scripts before each commit.
133+
134+
## Local Development
135+
136+
### First-Time Setup
137+
138+
```bash
139+
# Install bundler (without sudo)
140+
gem install bundler --user-install
141+
142+
# Install dependencies
143+
bundle install
144+
```
145+
146+
### Running Locally
147+
148+
```bash
149+
# Start development server
150+
bundle exec jekyll serve
151+
152+
# Site available at: http://localhost:4000
153+
```
154+
155+
### Testing
156+
157+
```bash
158+
# Build site
159+
bundle exec jekyll build
160+
161+
# Check for broken links
162+
bundle exec htmlproofer ./_site --disable-external
163+
```
164+
165+
## Style Guidelines
166+
167+
### Writing
168+
169+
- Use clear, concise language
170+
- Check spelling and grammar
171+
- Use proper citations for published work
172+
173+
### Images
174+
175+
- Optimize images before uploading
176+
- Use descriptive filenames
177+
- Keep file sizes small:
178+
- Member photos: ~50-100KB
179+
- Publication teasers: max 100KB
180+
- Post images: < 500KB
181+
182+
### Code
183+
184+
- Follow Jekyll conventions
185+
- Keep YAML files properly indented (2 spaces)
186+
- Use single quotes for strings in YAML
187+
- Escape single quotes with double single quotes: `Alzheimer''s`
188+
189+
## Questions?
190+
191+
If you have questions or run into issues, please:
192+
1. Check the templates in `_templates/`
193+
2. Review existing examples in the data files
194+
3. Contact the lab's web administrator
195+
196+
## Continuous Integration
197+
198+
All pull requests are automatically tested using GitHub Actions:
199+
- Jekyll build verification
200+
- HTML validation
201+
- Link checking
202+
203+
Make sure your changes pass these tests before requesting review.
204+
205+

Gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
source 'https://rubygems.org'
2+
3+
# Specify Ruby version for consistency
4+
ruby '>= 2.7.0'
5+
6+
# Core Jekyll gem for static site generation
27
gem "jekyll"
8+
9+
# GitHub Pages gem (includes Jekyll and plugins used by GitHub Pages)
310
gem 'github-pages'
11+
12+
# Pagination support for posts and publications
413
gem 'jekyll-paginate'
14+
15+
# HTML validation and link checking for CI/CD
516
gem "html-proofer"
17+
18+
# Required for Ruby 3.x to run Jekyll server
619
gem "webrick"

0 commit comments

Comments
 (0)