Skip to content

Migrate site from Jekyll to Astro#21

Merged
bgruening merged 20 commits intomainfrom
feature/jekyll-to-astro
Mar 23, 2026
Merged

Migrate site from Jekyll to Astro#21
bgruening merged 20 commits intomainfrom
feature/jekyll-to-astro

Conversation

@itisAliRH
Copy link
Copy Markdown
Member

@itisAliRH itisAliRH commented Mar 18, 2026

Summary

Migrates the GDPR documentation site from Jekyll 3.5–3.6 to Astro 6 static site generation.

What changed

  • Build system: Jekyll → Astro (npm run build, npm run dev)
  • Makefile: updated from Jekyll/Bundler commands to Astro/npm commands (make dev, make build, make preview), aligned with the Hub project's Makefile format
  • Layouts (_layouts/) → src/layouts/Default.astro, History.astro
  • Includes (_includes/) → src/components/ (Head, Header, Footer, Contact, HistoryBox, table components)
  • Data files (_data/) → src/data/ (unchanged YAML content)
  • Static assets (assets/) → public/assets/ (Bootstrap CSS, logo, unchanged)
  • Content pagessrc/pages/ (pure markdown pages keep layout via frontmatter; Liquid-heavy pages converted to .astro)
  • CI/CD: merge.yml/PR.ymldeploy.yml (artifact-based GitHub Pages) + pr.yml (build check)

Notable decisions

  • Data-driven tables (PII, data storage, DPA register) rendered via Astro build-time components using js-yaml + fs.readFileSync
  • Git history panel implemented with git log --follow at build time; --follow traces renames so pre-migration history is preserved after
    files move from repo root to src/pages/
  • History box branch link fixed from mastermain
  • dpa/index and lia/index generate as dpa.html/lia.html due to Astro's format: 'file' behavior; redirect stubs added at
    public/dpa/index.html and public/lia/index.html to preserve old directory-style URLs
  • RSS feed dropped (no value for a legal docs site)
  • Unused galaxy-eu-logo.inv.svg removed

Deployment note

After merging, the GitHub Pages source must be switched from "Deploy from a branch" to "GitHub Actions" in repo Settings → Pages.

Test plan

  • npm install && npm run build — 11 pages built successfully
  • All internal links resolve (index → scope/privacy-policy/tos/gdpr-rights/lia/gdpr-docs/dpa)
  • Data tables render with correct data and <abbr> tooltips
  • History box shows authors, revision count, and date on history-layout pages
  • Breadcrumb navigation works at all nesting levels (/, /lia/, /lia/grt)
  • Bootstrap 3 styling renders correctly (navbar, tables, footer)
  • Base path /gdpr correct for all asset URLs
  • /gdpr/dpa/ and /gdpr/lia/ redirect to the new .html URLs

Add package.json (Astro 4 + js-yaml + sass), astro.config.mjs (base=/gdpr,
format=file), tsconfig.json, and update .gitignore for Astro output directories
and legacy Jekyll git-metadata artifacts.
Convert _layouts/default.html and _layouts/history.html to Astro layouts
using <slot /> composition. Port _includes/ head/header/footer/contact to
Astro components. Move main.scss to src/styles/ (remove Jekyll front matter).

SCSS is imported in the layout and inlined by Astro — no separate main.css
request is made.
Move Bootstrap CSS and Galaxy EU logo from assets/ to public/assets/ so Astro
serves them as static files at /gdpr/assets/. Remove unused galaxy-eu-logo.inv.svg.
Move all content-only .md pages to src/pages/, updating the layout frontmatter
from Jekyll layout names to relative Astro layout paths.

Changes per page:
- scope, privacy-policy, tos: History layout, published_effective -> publishedEffective
- gdpr-rights: History layout (no publishedEffective)
- questions, notes: Default layout (no changes to content)
- lia/index: Default layout, fix relative link grt.html -> ./lia/grt.html
- lia/grt: History layout, replace kramdown {: .table.table-striped} with
  raw HTML <table class="table table-striped"> (Astro's markdown parser
  does not support kramdown attribute syntax)
Convert Liquid-templated pages (index, gdpr-docs, dpa/index) to .astro pages.
Extract table rendering into dedicated components (PiiTable, DataStorageTable,
DpaTable) that load YAML at build time via js-yaml + fs.readFileSync.

Person abbreviations use <abbr title> for name/affiliation tooltips, matching
the original Jekyll output.

YAML data files moved from _data/ to src/data/ (content unchanged).
Add src/utils/git-metadata.ts: calls git log --follow at build time to extract
authors, revision count, last commit date, and SHA for each history-layout page.
--follow traces renames so pre-migration history is preserved after files move
from the repo root to src/pages/.

Add HistoryBox.astro: renders a Bootstrap panel with authors, revision count,
effective/revised date, and links to the commit and full history on GitHub.
Fixes the branch name in history links from 'master' to 'main'.
Remove merge.yml (jekyll-deploy-action) and PR.yml (Jekyll test build).
Add deploy.yml: build with Node 20, upload dist/ as Pages artifact, deploy
via actions/deploy-pages. Requires Pages source set to 'GitHub Actions'.
Add pr.yml: Astro build check on pull requests.

Both workflows use fetch-depth: 0 for full git history (required by the
build-time git metadata utility).
Remove all Jekyll-specific files:
- Gemfile, Makefile, _config.yml
- _layouts/ and _includes/ (ported to src/layouts/ and src/components/)
- assets/css/main.scss (moved to src/styles/)
- .git-metadata/ JSON files (jekyll-git_metadata plugin artifacts)

Add public/dpa/index.html and public/lia/index.html as meta-refresh redirects
to dpa.html and lia.html. These preserve the old directory-style URLs
(/gdpr/dpa/ and /gdpr/lia/) that Jekyll served via index files; Astro's
format:'file' setting generates flat .html URLs instead.

Rewrite README with Astro dev workflow (npm install/dev/build/preview).
@itisAliRH itisAliRH added the enhancement New feature or request label Mar 18, 2026
Markdown pages pass frontmatter under Astro.props.frontmatter rather than
directly on Astro.props, causing lia/index.md to render with a blank h1
and bare 'GDPR' page title. Apply the same frontmatter fallback already
used in History.astro.
astro ^4.16.18 → ^4.16.19
js-yaml ^4.1.0 → ^4.1.1
sass ^1.80.7 → ^1.98.0
The legacy JS API is deprecated in Dart Sass and will be removed in 2.0.
Switching to modern-compiler API via vite.css.preprocessorOptions.scss.
…iling slash

Relative hrefs like ./scope.html resolve against the parent directory of
the current URL. When the index page is accessed as /gdpr (no trailing
slash), ./ resolves to / instead of /gdpr/, breaking all navigation links.
Using BASE_URL-anchored absolute paths makes them work regardless of
whether the trailing slash is present.
Copy link
Copy Markdown
Member

@bgruening bgruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment thread Makefile
…axy-hub

Replaced the removed Jekyll Makefile with an Astro-equivalent version
using the same dev/build/preview targets and help format as the
galaxyproject/galaxy-hub Makefile, as requested in PR review.
@itisAliRH itisAliRH marked this pull request as ready for review March 18, 2026 19:28
@itisAliRH itisAliRH changed the title [WIP] Migrate site from Jekyll to Astro Migrate site from Jekyll to Astro Mar 18, 2026
- Upgrade astro dependency from ^4.16.19 to ^6.0.6.
- Reorder devDependencies for consistency.
- actions/checkout: v4 → v6.0.2
- actions/setup-node: v4 → v6.3.0
- actions/upload-pages-artifact: v3 → v4.0.0
- actions/deploy-pages: v4 → v4.0.5
- Add concurrency group to pr.yml to cancel redundant runs
- Align node-version to 22 in deploy.yml (was 20)
Copy link
Copy Markdown
Member

@arash77 arash77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use major version tags for GitHub Actions instead of pinned patch versions. This simplifies maintenance by automatically incorporating bug fixes without manual updates.

Comment thread .github/workflows/PR.yml Outdated
Comment thread .github/workflows/PR.yml Outdated
Comment thread .github/workflows/deploy.yml Outdated
Comment thread .github/workflows/deploy.yml Outdated
Comment thread .github/workflows/deploy.yml Outdated
Comment thread .github/workflows/deploy.yml Outdated
Switch from pinned patch versions (e.g. @v6.0.2) to major version
tags (@v6, @v4) as suggested in PR review.
Comment thread README.md
Comment thread .git-metadata/5d858d9e7641f7d60c26ee71ca1827402f289744.json Outdated
@bgruening bgruening merged commit 4911262 into main Mar 23, 2026
1 check passed
@bgruening
Copy link
Copy Markdown
Member

Thanks a lot @itisAliRH

@bgruening bgruening deleted the feature/jekyll-to-astro branch March 23, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants