-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add automated testing, validation tools, and contributor docs #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
93bfa18
feat: add automated testing, validation tools, and contributor docs
m-reuter edee7b2
Update scripts/validate_yaml.rb
m-reuter 25dd2af
Update Gemfile
m-reuter 248ad50
Update scripts/validate_posts.sh
m-reuter 95ecddf
add validation to CI
m-reuter ab0942a
pub img warning size 100kb
m-reuter 9aae806
fix pre-commit hook script
m-reuter eb349e3
Update QUICKSTART.md
m-reuter 18e8ed5
Update scripts/pre-commit.sh
m-reuter 3f055ef
unify github path url
m-reuter 3683cc3
make validate-yaml work from any dir
m-reuter 0173170
backup images and cleanup
m-reuter 8550f84
path resolution fix
m-reuter 8165d31
add description to install imagemagick
m-reuter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| *~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| 3.1.0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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`) | ||
m-reuter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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. | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.