Skip to content

Commit d3c9161

Browse files
authored
Merge pull request #101 from Project-MONAI/feat/llm-friendly-revamp
Site revamp: light redesign, LLM enablement, analytics, Astro build
2 parents 6345da2 + 45b7269 commit d3c9161

290 files changed

Lines changed: 19933 additions & 25846 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.claude/settings.local.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.cursorrules

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,44 @@
1-
name: Build and Deploy
1+
name: Deploy to GitHub Pages
22

33
on:
4-
workflow_dispatch: # Allows manual trigger from GitHub UI
54
push:
6-
branches:
7-
- main
8-
- master
5+
branches: [master, main]
6+
workflow_dispatch:
97

10-
# Add permissions to allow deployment
118
permissions:
12-
contents: write
9+
contents: read
10+
11+
concurrency:
12+
group: pages
13+
cancel-in-progress: false
1314

1415
jobs:
15-
build-and-deploy:
16+
build:
1617
runs-on: ubuntu-latest
1718
steps:
18-
- name: Checkout Website
19-
uses: actions/checkout@v3
20-
21-
- name: Checkout Model Zoo
22-
uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2320
with:
24-
repository: project-monai/model-zoo
25-
path: scripts/model-zoo
26-
27-
- name: Setup Python and Node
28-
uses: actions/setup-python@v4
21+
persist-credentials: false
22+
- uses: actions/setup-node@v4
2923
with:
30-
python-version: '3.x'
31-
- uses: actions/setup-node@v3
24+
node-version: 20
25+
cache: npm
26+
- run: npm ci
27+
- run: npm test
28+
- run: npm run build
29+
- uses: actions/upload-pages-artifact@v3
3230
with:
33-
node-version: '18'
34-
cache: 'npm'
35-
36-
- name: Install Dependencies
37-
run: |
38-
pip install requests beautifulsoup4 markdown
39-
npm install
40-
41-
- name: Build Site
42-
run: |
43-
# Clean dist directory
44-
rm -rf dist
45-
mkdir -p dist
46-
mkdir -p dist/assets/css
47-
48-
# Process model data (both model-zoo and HF models)
49-
python scripts/process_models.py
50-
51-
# Build files
52-
npm run build
53-
# Copy Vue.js file directly (no babel needed for Vue 3)
54-
cp src/model-zoo-vue.js dist/src/model-zoo-vue.js
31+
path: ./dist
5532

56-
# Build Tailwind CSS explicitly
57-
npx tailwindcss -i ./assets/css/style.css -o ./dist/assets/css/tailwind.css --minify
58-
59-
# Copy necessary files
60-
cp scripts/model_data.json dist/
61-
62-
# Debug Tailwind CSS
63-
echo "Checking tailwind.css:"
64-
ls -la dist/assets/css/tailwind.css || true
65-
echo "Contents of dist/assets/css:"
66-
ls -la dist/assets/css || true
67-
68-
- name: Deploy to GitHub Pages
69-
uses: JamesIves/github-pages-deploy-action@v4
70-
with:
71-
folder: dist
72-
branch: gh-pages
73-
clean: true # Automatically remove deleted files from the deployment
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
permissions:
37+
pages: write
38+
id-token: write
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
steps:
43+
- uses: actions/deploy-pages@v4
44+
id: deployment

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ node_modules/
22
.ipynb_checkpoints
33
dist/
44
.claude/
5-
.DS_Store
5+
.agent-team/
6+
visual-baseline/
7+
visual-current/
8+
visual-diff/
9+
.astro/

404.html

Lines changed: 0 additions & 37 deletions
This file was deleted.

AGENTS.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# AGENTS.md: project-monai.github.io
2+
3+
This is the marketing/community website for the MONAI project. It is **not** the
4+
MONAI framework code; that lives at `Project-MONAI/MONAI`.
5+
6+
## Stack
7+
8+
- Astro 5.x (static site)
9+
- Tailwind 3.x
10+
- Model Zoo: a self-contained Vue 3 SPA (CDN UMD + `public/src/model-zoo-vue.js`,
11+
hash routing). It is NOT an Astro island; `@astrojs/vue` was removed 2026-06-10.
12+
- Deployed to GitHub Pages from `master` via `.github/workflows/deploy.yml`
13+
- Vitest for unit tests
14+
15+
## Dev setup
16+
17+
```bash
18+
npm install
19+
npm run dev # http://localhost:3000 + LAN IP
20+
npm run build # outputs dist/
21+
npm test # vitest unit tests
22+
```
23+
24+
## Code conventions
25+
26+
- Pages live under `src/pages/`. Default to `.astro` for new pages. `.md`/`.mdx`
27+
is supported but the site's existing pages use `.astro` for layout consistency.
28+
- Every page declares a `frontmatter` const with `title`, `description`,
29+
`canonical`. Optional: `audience` (array of `researcher` / `engineer` /
30+
`clinician` / `newcomer`), `schemaType` (`Course` / `Article` / `WebPage`),
31+
`metaRefresh` (for redirect-style pages).
32+
- Site visual conventions live in `docs/STYLEGUIDE.md` (component recipes) and
33+
`docs/DESIGN.md` (design direction, color roles, migration checklist, decision
34+
log). Read both before changing visual design; log notable decisions in
35+
DESIGN.md's decision log.
36+
- Tailwind classes only, no per-page CSS files.
37+
- **Asset naming**: images live in category folders with kebab-case names:
38+
`public/assets/img/people/<first-last>.<ext>` (headshots),
39+
`public/assets/img/logos/<org>.<ext>` (partner/contributor logos),
40+
`public/assets/img/figures/<page-or-topic>-<name>.<ext>` (figures/diagrams),
41+
and brand marks in `public/assets/logo/`. No spaces or CamelCase in filenames.
42+
- Follow the Writing voice rules in DESIGN.md for all user-facing copy and docs
43+
(no em dashes, no marketing AI-isms).
44+
- Inline `<script>` must use `is:inline` to bypass Vite processing.
45+
- **Analytics instrumentation** (event schema and GA4 setup: `docs/ANALYTICS.md`):
46+
when adding or editing a page, tag primary CTAs with
47+
`data-track="cta_click" data-track-cta-id="<page>_<slug>"
48+
data-track-cta-dest="<href>"`, and filter buttons with
49+
`data-track="filter_use"` + `data-track-filter-type/-value`.
50+
`public/assets/js/track.js` handles the rest; the footer markdown link
51+
(`md_twin_click`) ships site-wide automatically.
52+
53+
## Load-bearing invariants (do not break these)
54+
55+
- `build.format: 'file'` in `astro.config.mjs` emits `core.html`-style URLs. Internal
56+
hrefs are literal `*.html`, and the nav-active script and md-twins both parse `.html`
57+
filenames. The canonical URL must stay `https://project-monai.github.io` with `.html` paths.
58+
- Integration order in `astro.config.mjs` matters: `mdTwins()` must be registered before
59+
`llmsTxt()` (llms-full.txt reads the twins md-twins emits).
60+
- `src/integrations/llms-config.json` curates which pages concatenate into `llms-full.txt`.
61+
- The agent-detect script inlined in `BaseHead.astro` must run before gtag; treat that
62+
bootstrap as frozen (it has unit tests).
63+
- Tailwind's content globs must keep `./public/src/**/*.js`, or the Model Zoo's classes
64+
get purged from the compiled CSS.
65+
- After editing `public/src/model-zoo-vue.js`: run `node --check` on it, and keep both
66+
branches of `:class` ternaries as complete literal class strings (Tailwind scans literals).
67+
- `npm run build` first curls `model_data.json` from the live site (fallback:
68+
`model_data.sample.json`); keep that fallback file.
69+
70+
## Build expectations
71+
72+
`npm run build` must produce, in `dist/`:
73+
- One `.html` per page in `src/pages/`
74+
- One `.md` twin per page (via `src/integrations/md-twins.ts`)
75+
- `llms.txt`, `llms-full.txt`, `sitemap-index.xml`, `sitemap-llms.xml`,
76+
`robots.txt`
77+
78+
If any of these are missing after a build, the integration is broken.
79+
80+
## Testing
81+
82+
Vitest unit tests live under `tests/`. Run with `npm test`.
83+
84+
Visual regression tooling (optional, manual):
85+
- `npm run snapshot:current` captures dist screenshots with Puppeteer.
86+
- `npm run diff` compares against `visual-baseline/` (gitignored).
87+
88+
## Pointers (doc map)
89+
90+
- `docs/DESIGN.md`: design direction, color roles, alignment rules, decision log (canonical for "why")
91+
- `docs/STYLEGUIDE.md`: component-level class recipes
92+
- `docs/ARCHITECTURE.md`: stack decision (stay on Astro), simplification history, next steps
93+
- `docs/ANALYTICS.md`: GA4 operator guide (events, dimensions, dashboards)
94+
95+
## What NOT to do
96+
97+
- Don't add inline `<style>` blocks; use Tailwind utility classes.
98+
- Don't add `<!-- #include -->` directives; that pattern was retired with the
99+
Astro migration. Use Astro components.
100+
- Don't add new build scripts under `scripts/` without a clear reason; Astro
101+
integrations should handle most build-time work.
102+
- Don't bump `astro` to a major version (currently 5.x) without verifying the
103+
ecosystem integrations (`@astrojs/tailwind`, `@astrojs/sitemap`, `@astrojs/mdx`)
104+
and the custom `astro:build:done` integrations are compatible.
105+
- Don't re-add `@astrojs/vue`; nothing uses it (the Model Zoo is a CDN SPA).

0 commit comments

Comments
 (0)