Skip to content

Commit b04db8b

Browse files
committed
changes after LM
1 parent 76090f6 commit b04db8b

5 files changed

Lines changed: 958 additions & 102 deletions

File tree

‎README.md‎

Lines changed: 190 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,31 @@ Two parts: **project cards** (ongoing work) and **publications by theme** (finis
136136
#### Adding or editing a project card
137137

138138
Copy any existing `.research-card` block and update:
139-
- `data-theme` on the outer div: `"cancer"`, `"neuro"`, or `"bioinformatics"`
140-
- `.research-card-stripe` and `.research-theme-pill` class (must match `data-theme`)
139+
- `data-theme` on the outer div. Valid values: `"cancer"`, `"neuro"`, `"bioinformatics"`, `"biostatistics"`
140+
- **Multi-theme cards:** space-separate values — e.g. `data-theme="neuro biostatistics"`. JS automatically renders a gradient stripe and both pills.
141+
- `.research-card-stripe` — set the class to the **primary** theme; JS overwrites the background for gradients
142+
- `.research-theme-pills` wrapper — add one `.research-theme-pill.THEME` per theme
141143
- `.research-card-title` — short project name
142144
- `.research-keywords` — add/remove `<span class="research-keyword">` tags
143145
- `.research-card-people` — current members and collaborators
144-
- `.research-card-desc` — one paragraph description
146+
- `.research-card-desc` — one paragraph description shown when the card is clicked
145147
- `.research-card-pub-list` — relevant papers (use bold for lab members, `<sup>*</sup>` for co-firsts)
146148

149+
**To add a preprint link** on a card, include a `.research-card-preprint` paragraph inside `.research-card-detail`, with the link wrapping both the icon and label:
150+
151+
```html
152+
<p class="research-card-preprint">
153+
<a href="https://www.biorxiv.org/content/10.1101/XXXX" target="_blank" rel="noopener">
154+
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
155+
Preprint (bioRxiv)
156+
</a>
157+
</p>
158+
```
159+
160+
This renders as a pill badge inside the card and also appears in the modal when the card is opened. Preprints should appear on the card, **not** in the "Finished work" panels below (those are for peer-reviewed publications only — with the exception of preprints that are intentionally kept in a panel for historical reasons).
161+
162+
Each card has a visible **"Read abstract"** label with a chevron at the bottom. Clicking anywhere on the card (or pressing Enter/Space) opens a modal with the full description and any preprint link.
163+
147164
#### Adding a paper to a theme panel
148165

149166
In the "Finished work: publications by theme" section, find the right `<details>` panel and add a `<li>`:
@@ -154,6 +171,15 @@ In the "Finished work: publications by theme" section, find the right `<details>
154171

155172
The legend (`* co-first authors`) is already shown above the panels — no per-entry note needed here.
156173

174+
#### Adding a new research theme
175+
176+
To add a new theme (e.g. `myfield`):
177+
178+
1. Add a CSS block in `css/styles.css` for the dot, pill, hover, and panel colours (follow the pattern of `biostatistics` — choose colours that pass WCAG AA 4.5:1 contrast).
179+
2. Add `myfield: '#hexcolor'` to the `RESEARCH_THEME_COLOURS` object in `js/main.js`.
180+
3. Add a filter button in the `#research-filter-bar` in `sections/research.html`.
181+
4. Optionally add a `<details class="research-pub-panel" data-theme="myfield">` panel in the publications section.
182+
157183
---
158184

159185
### 🛠 Software — `sections/software.html`
@@ -204,6 +230,28 @@ The first image in the array is also used as the card thumbnail.
204230

205231
---
206232

233+
### 📡 BIOMICS news feed — `sections/news.html`
234+
235+
The News section includes a **BIOMICS spotlight** that auto-fetches the latest news items from [biomics.gimm.pt/news/feed/](https://biomics.gimm.pt/news/feed/) via an RSS-to-JSON proxy (`rss2json.com`). No API key is required. The feed is loaded by `loadBiomicsNews()` in `js/main.js` and rendered as photo cards.
236+
237+
To change the feed URL, update the `BIOMICS_FEED_URL` constant near the top of `loadBiomicsNews()`.
238+
239+
### 🎬 BIOMICS videos — `sections/news.html`
240+
241+
The BIOMICS YouTube videos also live in the News section and are specified in the `BIOMICS_VIDEOS` array in `js/main.js`. Each entry has a `videoId` and `title`.
242+
243+
**To add a video**, push a new entry to the array:
244+
245+
```js
246+
{ videoId: 'dQw4w9WgXcQ', title: 'BIOMICS Talk — June 2026' }
247+
```
248+
249+
**Click-to-play pattern** — videos render as a static thumbnail with a play button overlay. Clicking loads the YouTube iframe with autoplay. This defers the iframe until the user explicitly plays the video, keeping the page fast. Thumbnails are fetched directly from YouTube's CDN (`hqdefault.jpg`, 480×360) — no API key needed.
250+
251+
**Play button ARIA**: each thumbnail wrap has `role="button"`, `tabindex="0"`, and an `aria-label` of `"Play <title>"` for keyboard and screen-reader access.
252+
253+
---
254+
207255
### 📚 Publications widget — `sections/publications.html`
208256

209257
This is the short highlights widget shown on the **main page** (not the full publications page). It auto-populates from the entries marked `data-selected="true"` in `publications.html`. You generally don't need to edit this file directly — just toggle `pubs-selected` on the papers you want featured.
@@ -448,12 +496,151 @@ Always open external links in a new tab:
448496

449497
---
450498

499+
## Accessibility (ARIA)
500+
501+
**ARIA** stands for *Accessible Rich Internet Applications*. It is a set of HTML attributes defined by the W3C (the web standards body) that describe the *purpose and state* of UI elements to assistive technologies — primarily screen readers used by people with visual impairments.
502+
503+
Without ARIA, a screen reader encountering a `<div>` that opens a modal when clicked has no idea what it does. ARIA lets you annotate it: `role="button"` says "this is a button", `aria-label="Close modal"` says what the button does, `aria-modal="true"` tells the screen reader the dialog is modal so it doesn't read background content.
504+
505+
### What has been implemented on this site
506+
507+
- **Research card modals** — each card has `role="button"`, `tabindex="0"` (keyboard focusable), and responds to Enter/Space. The modal itself has `role="dialog"`, `aria-modal="true"`, and `aria-labelledby` pointing to the modal title heading. Focus is moved to the Close button when the modal opens.
508+
- **Modal close button** — labelled with `aria-label="Close modal"` (visible icon only, no text).
509+
- **Bluesky feed cards** — each post card has `tabindex="0"`, `role="button"`, and an `aria-label` with the post text.
510+
- **Photo lightbox** — `role="dialog"`, `aria-modal="true"`, `aria-label="Full-size photo"`.
511+
- **Carousel navigation buttons** — each dot/button has `aria-label="Go to slide N"`.
512+
- **Decorative icons and images** — marked `aria-hidden="true"` so screen readers skip them.
513+
- **RSS feed icon** in the BIOMICS news label — `aria-hidden="true"`.
514+
- **BIOMICS video thumbnails** — each thumbnail wrapper has `role="button"`, `tabindex="0"`, and `aria-label="Play <video title>"`. The SVG play icon is `aria-hidden="true"`. Pressing Enter or Space triggers playback.
515+
516+
### WCAG AA colour contrast
517+
518+
All foreground/background colour combinations were audited programmatically against the WCAG 2.1 Level AA threshold (4.5:1 for normal text, 3:1 for large text). Several colours were adjusted to pass — see the colour variables in `css/styles.css` (`:root`) for the current accessible values. The key changes were:
519+
520+
| Token | Before | After | Reason |
521+
|---|---|---|---|
522+
| `--teal` | `#0D9488` | `#087c72` | Failed on white (3.74:1) |
523+
| `--teal-on-dark` | — | `#14B8A6` | Separate token for dark-bg contexts |
524+
| `--slate` | `#64748B` | `#5f6e85` | Failed on fog bg (4.31:1) |
525+
| Muted captions | `#94A3B8` | `#65707e` | Failed on white (2.56:1) |
526+
| Cancer pill text | `#e11d48` | `#c71640` | Failed on pill bg (4.28:1) |
527+
| Bio pill text | `#0d9488` | `#087c72` | Failed on pill bg (3.59:1) |
528+
| Biostatistics pill text | — | `#92400e` (amber-800) | New theme; ~7.5:1 on `#fffbeb` pill bg |
529+
530+
### Further improvements to consider
531+
532+
- Add `lang="en"` to the `<html>` tag in all pages (already present in `index.html` — verify standalone pages).
533+
- Add `<title>` elements to standalone pages that are currently generic.
534+
- Ensure all form inputs (if any are added in future) have associated `<label>` elements.
535+
- Test with an actual screen reader (e.g. VoiceOver on macOS: Cmd+F5) for a real-world check.
536+
537+
---
538+
451539
## Bluesky feed
452540

453541
The News section automatically fetches the most recent posts from `@nmoraislab.bsky.social` via the public AT Protocol API (no key required). Reposts are filtered out. To change the account, edit the `HANDLE` constant at the top of `loadBlueskyFeed()` in `js/main.js`.
454542

455543
---
456544

545+
## Visual content editor (Decap CMS) — optional setup
546+
547+
> **What this gives you:** a web interface at `https://diseasetranscriptomicslab.github.io/admin/` where anyone with GitHub access can edit site content (news, team members, publications) through forms — no git knowledge or terminal needed. Changes are committed directly to GitHub and deploy automatically.
548+
549+
This is optional. The site works fine without it. Set it up when you're ready to let non-technical collaborators edit content.
550+
551+
---
552+
553+
### Step 1 — Create the GitHub OAuth App
554+
555+
GitHub OAuth is what lets Decap log people in using their GitHub account.
556+
557+
1. Go to **GitHub → Settings → Developer settings → OAuth Apps → New OAuth App** (direct link: <https://github.com/settings/developers>).
558+
2. Fill in:
559+
- **Application name:** `Disease Transcriptomics Lab CMS`
560+
- **Homepage URL:** `https://diseasetranscriptomicslab.github.io`
561+
- **Authorization callback URL:** `https://api.netlify.com/auth/done`
562+
3. Click **Register application**.
563+
4. On the next page, copy the **Client ID** and click **Generate a new client secret** — copy that too. Keep both safe.
564+
565+
---
566+
567+
### Step 2 — Connect Netlify as the OAuth broker
568+
569+
Decap uses Netlify purely as an OAuth middleman (free, no hosting required).
570+
571+
1. Create a free account at <https://app.netlify.com> if you don't have one.
572+
2. Go to **Sites → Add new site → Deploy manually** and drag any dummy folder to create a placeholder site. The site URL doesn't matter.
573+
3. Go to **Site configuration → Access & security → OAuth**.
574+
4. Under **Authentication providers**, click **Install provider → GitHub**.
575+
5. Paste your **Client ID** and **Client secret** from Step 1, then click **Install**.
576+
577+
---
578+
579+
### Step 3 — Add the `admin/` folder to this repo
580+
581+
Create these two files and commit them (to a branch, then PR into `main`):
582+
583+
**`admin/index.html`** — the CMS entry point:
584+
585+
```html
586+
<!doctype html>
587+
<html>
588+
<head>
589+
<meta charset="utf-8" />
590+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
591+
<title>Disease Transcriptomics Lab CMS</title>
592+
</head>
593+
<body>
594+
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
595+
</body>
596+
</html>
597+
```
598+
599+
**`admin/config.yml`** — tells Decap which files to edit:
600+
601+
```yaml
602+
backend:
603+
name: github
604+
repo: YOUR-ORG/nmoraislab.github.io # ← replace with actual repo path
605+
branch: main
606+
607+
media_folder: assets/news
608+
public_folder: assets/news
609+
610+
collections:
611+
- name: news
612+
label: Lab News
613+
folder: _data/news
614+
create: true
615+
slug: "{{year}}-{{month}}-{{slug}}"
616+
fields:
617+
- { label: Title, name: title, widget: string }
618+
- { label: Date, name: date, widget: string, hint: "e.g. June 2026" }
619+
- { label: Summary, name: summary, widget: text }
620+
- { label: Content, name: content, widget: markdown }
621+
- { label: Image, name: image, widget: image, required: false }
622+
```
623+
624+
> **Note:** Decap works best when content is stored as Markdown/YAML files. Adapting the current JavaScript-array format (`js/news-data.js`) to file-based content requires a small migration — contact the person who built the site for help with that step.
625+
626+
---
627+
628+
### Step 4 — Open the editor
629+
630+
Once the `admin/` folder is live on GitHub Pages:
631+
632+
1. Visit `https://diseasetranscriptomicslab.github.io/admin/`
633+
2. Click **Login with GitHub** and authorise.
634+
3. You'll see the content collections. Edit, save — changes commit to the repo and deploy automatically.
635+
636+
---
637+
638+
### Access control
639+
640+
Only GitHub accounts that have **read access to this repository** can log in via Decap. Manage collaborators under **GitHub → Repository → Settings → Collaborators and teams**. There is no separate Decap user list.
641+
642+
---
643+
457644
## Analytics
458645

459646
The site supports **Google Analytics 4**. To activate it, create a property at [analytics.google.com](https://analytics.google.com), then add the following snippet inside the `<head>` of `index.html`, `publications.html`, `news.html`, and `sections/nuno.html` — replacing `G-XXXXXXXXXX` with your Measurement ID:

0 commit comments

Comments
 (0)