Skip to content

Commit 7e61a39

Browse files
authored
Merge pull request #3763 from dannon/content-migration
Normalize legacy content syntax at the source
2 parents 0d56be1 + 37fbd09 commit 7e61a39

File tree

797 files changed

+4807
-5716
lines changed

Some content is hidden

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

797 files changed

+4807
-5716
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ jobs:
5353
- name: Validate metadata
5454
run: uv run --python 3.12 --with pykwalify --with pyyaml make validate-metadata
5555

56+
content-lint:
57+
name: Content Lint
58+
runs-on: ubuntu-latest
59+
defaults:
60+
run:
61+
working-directory: .
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v5
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v6
68+
with:
69+
node-version: '22'
70+
cache: 'npm'
71+
cache-dependency-path: astro/package-lock.json
72+
73+
- name: Lint content
74+
run: cd astro && npm ci && npm run content:lint
75+
5676
unit-tests:
5777
name: Unit Tests
5878
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 73 additions & 736 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ check: ## Format, lint, and test Astro site
4545
cd astro && npm install && npm run format && npm run lint && npm test
4646
.PHONY: check
4747

48+
content-lint: ## Lint content files for legacy syntax issues
49+
cd astro && npm install && npm run content:lint
50+
.PHONY: content-lint
51+
4852
link-check: build ## Build site and check internal links with linkinator
4953
cd astro && npx astro preview --port 9999 & sleep 5 && cd astro && PORT=9999 npm run links:internal; kill %1 2>/dev/null || true
5054
.PHONY: link-check

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
# Galaxy Community Hub
22

3-
The [Galaxy Community Hub](https://galaxyproject.org) ↗️ is the community and documentation website for the [Galaxy Project](https://galaxyproject.org/use/)↗️. The Hub is maintained by the community through this GitHub repository. To update the Hub, (1) visit the [Hub "About" page](https://galaxyproject.org/hub/)↗️ and (2) view the links in this `README.md` file [Table of Contents](#table-of-contents).
3+
Source for the [Galaxy Community Hub](https://galaxyproject.org), the community and documentation website for the [Galaxy Project](https://galaxyproject.org). The site is built with [Astro](https://astro.build/) and content is written in Markdown. The Hub is maintained by the community through this GitHub repository.
44

5-
## About the Galaxy Project
5+
- **Galaxy Project**: https://galaxyproject.org
6+
- **Galaxy Server (usegalaxy.org)**: https://usegalaxy.org
7+
- **Galaxy Training Network**: https://training.galaxyproject.org
8+
- **GitHub Issues**: https://github.com/galaxyproject/galaxy-hub/issues
69

7-
To learn more about the Galaxy Project, visit the [Hub "Home" page](https://galaxyproject.org)↗️.
10+
## Contributing
811

9-
## Table of contents
12+
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to add or edit content, and the [Contributing](https://galaxyproject.org/hub/contributing/) page on the Hub itself.
1013

11-
1. Structuring Content, Files, and URLs
12-
1. [Markdown](content/hub/contributing/markdown/index.md) - How to format paragraphs and images
13-
2. [File Organization and URLs](content/hub/contributing/file-organization/index.md) - How to name files and structure URL paths
14-
3. [Static and Dynamic Pages](content/hub/contributing/file-organization/index.md#static-pages) - How to display list of pages, custom layouts, and categorized pages
15-
4. [Subsites](content/hub/global/index.md) - How to access existing subsites or start your own Hub subsite
16-
2. Contributing Content, Images, and Code (multiple options to publish changes)
17-
1. [[Option 1] Editors](content/hub/contributing/index.md#option-1) - Do it all in Github
18-
2. [[Option 2] Developers](content/hub/contributing/index.md#option-2) - Clone the repository (and run in your local environment)
14+
## Quick reference
15+
16+
- **Content directory**: [`/content/`](/content/) — all Markdown content lives here
17+
- **Astro site**: [`/astro/`](/astro/) — site source code, build scripts, components
18+
- **Dev server**: `make dev`http://localhost:4321
19+
- **Build**: `make build`
20+
- **All targets**: `make help`
1921

2022
## License
2123

22-
The [contents](/contents/) of the Galaxy Hub are licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0).
24+
The [contents](/content/) of the Galaxy Hub are licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0).
2325

24-
The code behind the infrastructure is licensed under the [MIT License](LICENSE.md)
26+
The code behind the infrastructure is licensed under the [MIT License](LICENSE.md).

astro/README.md

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,90 @@
1-
# Galaxy Community Hub - Astro Migration
1+
# Galaxy Community Hub Astro Site
22

3-
This is the Astro-based implementation of the Galaxy Community Hub, migrating from the existing Gridsome setup.
3+
The Astro-based Galaxy Community Hub at [galaxyproject.org](https://galaxyproject.org). Content lives in `/content/` at the repo root and is preprocessed into `src/content/` (gitignored) during build.
44

55
## Development
66

77
```bash
8-
# Install dependencies
8+
cd astro
99
npm install
10-
11-
# Start dev server (http://localhost:4321)
12-
# Automatically preprocesses content, generates redirects, and builds search index
13-
npm run dev
10+
npm run dev # http://localhost:4321
1411
```
1512

13+
The dev command preprocesses content, generates redirects and search index, then starts the dev server with hot reload.
14+
1615
## Building
1716

1817
```bash
19-
# Build for production
20-
npm run build
21-
22-
# Preview production build
23-
npm run preview
18+
npm run build # full production build
19+
npm run preview # serve the built site locally
2420
```
2521

2622
## Code Quality
2723

2824
```bash
29-
# Run ESLint
30-
npm run lint
31-
32-
# Fix auto-fixable lint issues
33-
npm run lint:fix
34-
35-
# Check formatting
36-
npm run format:check
37-
38-
# Fix formatting
39-
npm run format
25+
npm run lint && npm run format:check # check
26+
npm run lint:fix && npm run format # fix
27+
npm run content:lint # check content normalization
4028
```
4129

4230
## Testing
4331

4432
```bash
45-
# Run Playwright tests
46-
npm run test
33+
npm run test # Playwright E2E (starts dev server automatically)
34+
npm run test:ui # Playwright with interactive UI
35+
npm run test:unit # Vitest unit tests
36+
npm run test:unit:watch # Vitest in watch mode
37+
```
38+
39+
## Content and MDX
4740

48-
# Run tests with UI
49-
npm run test:ui
41+
Content files are plain markdown by default. Files that use interactive components (like `<Icon>`, `<VegaEmbed>`, `<Twitter>`, etc.) must opt in to MDX processing by adding `components: true` to their frontmatter:
5042

51-
# Run unit tests
52-
npm run test:unit
43+
```yaml
44+
---
45+
title: My Page
46+
components: true
47+
---
5348
```
5449

50+
Without this flag, component tags will not be rendered. The `npm run content:lint` command (also part of `--check` mode in normalize-content) will flag files where the flag is out of sync with actual component usage.
51+
52+
### Available components
53+
54+
Icon, VegaEmbed, Twitter, Mastodon, VideoPlayer, Carousel, Flickr, Supporters, Contacts, MarkdownEmbed, CalendarEmbed, Insert.
55+
56+
### MDX compatibility
57+
58+
Since MDX files are parsed as JSX, a few things that work in plain markdown will break in MDX:
59+
60+
- **HTML comments**: Use `{/* comment */}` instead of `<!-- comment -->`
61+
- **Bare `<>`**: Use `&lt;&gt;` instead
62+
- **Angle brackets before numbers/dashes**: e.g. `<500` or `<---` need escaping
63+
64+
These only matter in files with `components: true`. Plain markdown files are unaffected.
65+
66+
## Build Pipeline
67+
68+
Content preprocessing (`src/build/preprocess.mjs`) reads from `/content/` and writes to `src/content/`:
69+
70+
1. Files are sorted into collections (articles, events, news, platforms, bare-articles, inserts)
71+
2. Legacy syntax is converted (kramdown attributes, old Gridsome tags)
72+
3. Slugs are normalized (camelCase split, underscore→hyphen, lowercase)
73+
4. Images are copied to `public/images/{slug}/` and paths rewritten
74+
5. Files with `components: true` become `.mdx`; everything else stays `.md`
75+
5576
## Project Structure
5677

5778
```
5879
astro/
5980
├── src/
60-
│ ├── components/ # Vue and Astro components
61-
│ ├── layouts/ # Page layouts (Article, Home, Platform, etc.)
81+
│ ├── build/ # Preprocessing, normalization, search index
82+
│ ├── components/ # Vue 3 and Astro components
83+
│ │ └── mdx/ # Components available in MDX content
84+
│ ├── layouts/ # Page layouts
6285
│ ├── pages/ # File-based routing
63-
│ ├── styles/ # Global CSS
86+
│ ├── styles/ # Global CSS (Tailwind 4)
6487
│ └── content.config.ts
65-
├── public/ # Static assets
66-
└── content/ # Symlinked from parent (news, events, etc.)
88+
├── public/ # Static assets (images copied here during build)
89+
└── tests/ # Playwright E2E tests
6790
```
68-
69-
## Notes
70-
71-
- This is a parallel development effort - the existing Gridsome site remains unchanged
72-
- Content is shared with the parent directory via symlinks
73-
- Uses Tailwind CSS with Galaxy brand colors
74-
- Vue 3 components for interactive elements

astro/package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astro/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@
2323
"lint": "eslint . --ext .js,.mjs,.ts,.vue,.astro",
2424
"lint:fix": "eslint . --ext .js,.mjs,.ts,.vue,.astro --fix",
2525
"format": "prettier --write 'src/**/*.{js,mjs,ts,vue,astro,css}'",
26-
"format:check": "prettier --check 'src/**/*.{js,mjs,ts,vue,astro,css}'"
26+
"format:check": "prettier --check 'src/**/*.{js,mjs,ts,vue,astro,css}'",
27+
"normalize": "node src/build/normalize-content.mjs",
28+
"content:lint": "node src/build/normalize-content.mjs --all --check"
2729
},
2830
"dependencies": {
2931
"@astrojs/mdx": "^4.3.13",
3032
"@astrojs/rss": "^4.0.15",
3133
"@astrojs/sitemap": "^3.7.0",
3234
"@astrojs/vue": "^5.1.4",
35+
"@citation-js/core": "^0.6.9",
36+
"@citation-js/plugin-bibtex": "^0.6.9",
3337
"@fontsource/atkinson-hyperlegible": "^5.2.8",
3438
"@nanostores/vue": "^1.0.1",
3539
"@sindresorhus/slugify": "^2.2.1",
36-
"@citation-js/core": "^0.6.9",
37-
"@citation-js/plugin-bibtex": "^0.6.9",
3840
"@tailwindcss/typography": "^0.5.19",
3941
"@tailwindcss/vite": "^4.1.17",
4042
"@vueuse/core": "^14.1.0",
@@ -43,6 +45,7 @@
4345
"clsx": "^2.1.1",
4446
"glob": "^13.0.0",
4547
"gray-matter": "^4.0.3",
48+
"lucide-static": "^0.575.0",
4649
"lucide-vue-next": "^0.555.0",
4750
"marked": "^17.0.1",
4851
"nanostores": "^1.1.0",
@@ -71,10 +74,10 @@
7174
"eslint-plugin-astro": "^1.2.0",
7275
"eslint-plugin-vue": "^9.28.0",
7376
"fast-xml-parser": "^5.4.1",
77+
"linkinator": "^6.1.2",
7478
"prettier": "^3.3.0",
7579
"prettier-plugin-astro": "^0.14.0",
7680
"tw-animate-css": "^1.4.0",
77-
"linkinator": "^6.1.2",
7881
"vitest": "^4.0.15"
7982
}
8083
}

0 commit comments

Comments
 (0)