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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
branches: [ main, master ]
push:
branches: [ main, master ]

jobs:
validate-and-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Validate YAML files
run: ruby scripts/validate_yaml.rb

- name: Validate posts
run: bash scripts/validate_posts.sh

- name: Build Jekyll site
run: bundle exec jekyll build
env:
JEKYLL_ENV: production

- name: Test with html-proofer
run: |
bundle exec htmlproofer ./_site \
--disable-external \
--ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/" \
--allow-hash-href

29 changes: 28 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore

# Node.js
node_modules
dist
.cache

# Jekyll
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Ruby
.bundle/
vendor/bundle/
*.gem

# OS
.DS_Store
Gemfile.lock
Thumbs.db

# Editor
.vscode/
.idea/
*.swp
*.swo
*~
2 changes: 2 additions & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3.1.0

212 changes: 212 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# Contributing to Deep-MI Website

Thank you for contributing to the Deep-MI lab website! This guide will help you add content correctly.

## Table of Contents

- [Creating News Posts](#creating-news-posts)
- [Adding Members](#adding-members)
- [Adding Publications](#adding-publications)
- [Validation Before Committing](#validation-before-committing)
- [Local Development](#local-development)

## Creating News Posts

1. **Create a new file** in `_posts/` directory
2. **Name it**: `YYYY-MM-DD-Short-Title.md` (e.g., `2026-02-13-New-Grant.md`)
3. **Use the template** from `_templates/post-template.md`

### Required Front Matter

```yaml
---
title: Your Article Title
author: First Lastname
layout: post
group: news
---
```

### Tips

- Use Markdown for formatting
- Include images in `/static/img/` directory
- Keep image file sizes reasonable (< 500KB)

## Adding Members

1. **Add member info** to `_data/members.yml`
2. **Prepare photo**: 365×365 pixels, 72 DPI, JPEG format
3. **Save photo** to `/static/img/members/lastname.jpg`
4. **Use the template** from `_templates/member-template.md`

### Required Fields

- `name`: Full name
- `image`: Path to photo (e.g., `/static/img/members/lastname.jpg`)
- `position`: Job title

### Optional Fields

- `email`: Email address
- `scholar`: Google Scholar ID
- `twitter`: Twitter handle
- `orcid`: ORCID identifier
- `github`: GitHub username
- `description`: Biography (use single quotes for multi-line)

## Adding Publications

1. **Add publication info** to `_data/publications.yml`
2. **Prepare teaser image**: Max 200px height, JPEG, max 100KB
3. **Save files**:
- Image: `/static/pub/paper_id.jpg`
- BibTeX: `/static/pub/paper_id.bib`
- PDF (optional): `/static/pub/paper_id.pdf`
4. **Use the template** from `_templates/publication-template.md`

### Required Fields

- `id`: Unique identifier (usually `lastname_year`)
- `authors`: Author list (bold lab members: `**Name**`)
- `title`: Paper title
- `journal`: Journal/conference name
- `type`: One of: journal, conference, workshop, abstract, poster, preprint
- `year`: Publication year

### Recommended Fields

- `doi`: Digital Object Identifier
- `image`: Teaser image path
- `bibtex`: BibTeX file path
- `pdf`: Link to open access PDF or local file

## Validation Before Committing

Always validate your changes before committing:

```bash
# Validate YAML files
./scripts/validate_yaml.rb

# Validate post filenames and format
./scripts/validate_posts.sh

# Test the site locally
bundle exec jekyll serve
```

Visit http://localhost:4000 to preview your changes.

## Automation Tools

### Image Optimization

Optimize images to meet size requirements:

```bash
# Optimize a single member photo (365x365, 72 DPI)
./scripts/optimize_images.sh member static/img/members/lastname.jpg

# Optimize a single publication teaser (max 200px height, max 100KB)
./scripts/optimize_images.sh pub static/pub/paper_id.jpg

# Optimize all member photos at once
./scripts/optimize_images.sh all-members

# Optimize all publication teasers at once
./scripts/optimize_images.sh all-pubs
```

**Requirements**: ImageMagick

**Installation**:
- macOS: `brew install imagemagick`
- Ubuntu/Debian: `sudo apt-get install imagemagick`
- Fedora/RHEL: `sudo yum install imagemagick` or `sudo dnf install imagemagick`
- Arch Linux: `sudo pacman -S imagemagick`
- Windows: Download from [imagemagick.org](https://imagemagick.org/script/download.php#windows) or use `choco install imagemagick`

### Pre-commit Hook

Install a pre-commit hook to automatically validate changes:

```bash
cp scripts/pre-commit.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
```

This will automatically run validation scripts before each commit.

## Local Development

### First-Time Setup

```bash
# Install bundler (without sudo)
gem install bundler --user-install

# Install dependencies
bundle install
```

### Running Locally

```bash
# Start development server
bundle exec jekyll serve

# Site available at: http://localhost:4000
```

### Testing

```bash
# Build site
bundle exec jekyll build

# Check for broken links
bundle exec htmlproofer ./_site --disable-external
```

## Style Guidelines

### Writing

- Use clear, concise language
- Check spelling and grammar
- Use proper citations for published work

### Images

- Optimize images before uploading
- Use descriptive filenames
- Keep file sizes small:
- Member photos: max 100KB
- Publication teasers: max 100KB
- Post images: max 500KB

### Code

- Follow Jekyll conventions
- Keep YAML files properly indented (2 spaces)
- Use single quotes for strings in YAML
- Escape single quotes with double single quotes: `Alzheimer''s`

## Questions?

If you have questions or run into issues, please:
1. Check the templates in `_templates/`
2. Review existing examples in the data files
3. Contact the lab's web administrator

## Continuous Integration

All pull requests are automatically tested using GitHub Actions:
- Jekyll build verification
- HTML validation
- Link checking

Make sure your changes pass these tests before requesting review.


10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
source 'https://rubygems.org'
gem "jekyll"

# Specify Ruby version for consistency
ruby '>= 2.7.0'

# GitHub Pages gem (includes Jekyll and plugins used by GitHub Pages)
gem 'github-pages'
gem 'jekyll-paginate'
# HTML validation and link checking for CI/CD
gem "html-proofer"

# Required for Ruby 3.x to run Jekyll server
gem "webrick"
Loading