|
| 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 | + |
0 commit comments