The front page (index.md) automatically displays all Risk Assessments and Safe Work Procedures without manual editing. This is achieved through Jekyll's collection system.
-
Jekyll Collections: The site uses two collections defined in
_config.yml:_risk_assessments/- All risk assessment documents_safe_work_procedures/- All safe work procedure documents
-
Automatic Detection: Jekyll automatically finds all markdown files in these directories
-
Front Matter Fields: Each document's YAML front matter includes metadata that appears on the index page
-
Liquid Templating: The index page uses Liquid code to loop through collections and display cards
For a document to appear correctly on the index page, include these fields in the YAML front matter:
---
layout: document
title: Risk Assessment - [Equipment Name]
doc_type: Risk Assessment
status: Approved # or "Draft"
permalink: /risk-assessments/equipment-slug/
equipment_name: "[Equipment Name]" # Required for card title
reference: "SAIL-RA-EQUIPMENT-XXX" # Required for display
version: "1.0" # Required for display
description: "[Brief description for card]" # Optional but recommended
key_hazards: "[Comma-separated hazards]" # Optional but recommended
------
layout: document
title: Safe Work Procedure - [Equipment Name]
doc_type: Safe Work Procedure
status: Approved # or "Draft"
permalink: /safe-work-procedures/equipment-slug/
equipment_name: "[Equipment Name]" # Required for card title
reference: "SAIL-SWP-EQUIPMENT-XXX" # Required for display
version: "1.0" # Required for display
description: "[Brief description for card]" # Optional but recommended
includes: "[What the procedure includes]" # Optional but recommended
---Status Sorting:
- Approved documents appear first
- Draft documents appear after approved ones
- Within each status group, documents are sorted alphabetically by
equipment_name
Valid Status Values:
Approved- Fully approved and ready for useDraft- Work in progress or under review
-
Copy the template:
cp _templates/risk-assessment-template.md _risk_assessments/my-equipment.md # or cp _templates/safe-work-procedure-template.md _safe_work_procedures/my-equipment.md -
Update the front matter:
- Change
equipment_nameto the actual equipment name - Update
referencewith the correct document number - Fill in
descriptionandkey_hazards(orincludesfor SWPs) - Update
permalinkto match the filename - Set
statusto "Draft" initially
- Change
-
Complete the document content:
- Fill in all sections
- Replace all
[placeholder text] - Follow the template structure
-
The document will automatically appear on the index page when you commit and push
-
Change status to "Approved" when the document is reviewed and approved
Files should be named:
- Lowercase
- Hyphen-separated
- Match the permalink
- Example:
bambu-h2d.mdfor/risk-assessments/bambu-h2d/
# Start Jekyll server
bundle exec jekyll serve
# View at http://localhost:4000/SAIL-RA-SWP/The index page will automatically show all documents in the collections.
Document not appearing?
- Check the file is in the correct directory (
_risk_assessments/or_safe_work_procedures/) - Verify the front matter has valid YAML syntax (proper indentation, quotes)
- Ensure required fields are present:
equipment_name,reference,version,status - Check that
statusis exactly "Approved" or "Draft" (case-sensitive) - Restart Jekyll server:
Ctrl+Cthenbundle exec jekyll serve
Document showing but looks wrong?
- Verify
equipment_nameis set (used for card title) - Check
descriptionandkey_hazards/includesare filled in - Ensure
referenceandversionare correct
Sorting wrong?
- Documents are sorted by status (Approved first) then alphabetically by
equipment_name - Check
equipment_namespelling if order seems wrong
You never need to edit index.md to add documents!
Just create the markdown file in the appropriate collection folder with correct front matter, and it will automatically appear.
-
Create files:
touch _risk_assessments/3sae-cms.md touch _safe_work_procedures/3sae-cms.md
-
Add front matter to
_risk_assessments/3sae-cms.md:--- layout: document title: Risk Assessment - CMS 3SAE Electron Microscope doc_type: Risk Assessment status: Draft permalink: /risk-assessments/3sae-cms/ equipment_name: "CMS 3SAE Electron Microscope" reference: "SAIL-RA-3SAE-CMS-001" version: "1.0" description: "Risk assessment for the CMS 3SAE scanning electron microscope covering electron beam hazards, X-ray radiation, vacuum systems, and chemical safety." key_hazards: "X-ray radiation, electron beam, vacuum hazards, hazardous chemicals" metadata: reference: SAIL-RA-3SAE-CMS-001 title: CMS 3SAE Electron Microscope version: "1.0" issue_date: February 2026 prepared_by: Chris Betters supervisors: Chris Betters, Sergio Leon-Saval review_date: February 2027 ---
-
Complete the document content
-
Commit and push - document automatically appears on index page!
✅ No manual index maintenance ✅ Consistent formatting ✅ Automatic sorting (Approved first, then alphabetical) ✅ Easy to add new documents ✅ Reduces errors and omissions ✅ Always up-to-date
/index.md- Front page with auto-population code/_config.yml- Collection definitions/_templates/risk-assessment-template.md- RA template with all required fields/_templates/safe-work-procedure-template.md- SWP template with all required fields