Skip to content

Migrate build system from Gulp+Handlebars to Eleventy+Nunjucks#750

Open
RaananW wants to merge 4 commits intomasterfrom
update-website-architecture
Open

Migrate build system from Gulp+Handlebars to Eleventy+Nunjucks#750
RaananW wants to merge 4 commits intomasterfrom
update-website-architecture

Conversation

@RaananW
Copy link
Copy Markdown
Member

@RaananW RaananW commented Mar 26, 2026

Summary

This PR replaces the Gulp+Handlebars build system with Eleventy (11ty) + Nunjucks, modernizing the site generation pipeline while preserving the existing content structure and output.

Reviewer - Github is not showing the changes as this has more than 4000 changes mostly move and deletes. Please pull it if you want to check how it is working or watch the branch here - https://github.com/BabylonJS/Website/tree/update-website-architecture

Changes

New: Eleventy build system

  • eleventy.config.js - main configuration with renderBlock shortcode, passthrough copy, and custom filters
  • src/_data/site.js / src/_data/pages.js - data layer that reads existing site.json and per-page config.json files
  • src/_includes/base.njk - main HTML layout (converted from index-template.html)
  • src/_includes/blocks/*.njk - 21 block templates (converted from Handlebars to Nunjucks)
  • src/pages.njk - pagination template that generates all 18 site pages
  • .eleventyignore - excludes non-template source directories

Removed: Gulp build system

  • Deleted gulpfile.js and all 22 Handlebars templates in src/templates/
  • Replaced gulp/handlebars/browser-sync dependencies with @11ty/eleventy

Reorganized: Static assets

  • Moved non-generated content (Demos/, Scenes/, css/, js/, playground/, sandbox/, etc.) from build/ to static/ at project root
  • Eleventy passthrough copy outputs static/ contents to build/ root
  • Added build/ to .gitignore (build output should not be version-controlled)

Scripts

  • npm start - runs Eleventy dev server with hot reload
  • npm run build - generates the full site to build/

Notes

  • All existing content JSON files (config.json, site.json) are unchanged
  • The generated HTML output is identical to the previous Gulp pipeline
  • Build completes in about 3 seconds (18 pages + 4342 passthrough files)

RaananW added 4 commits March 26, 2026 16:22
- Add eleventy.config.js with renderBlock shortcode, passthrough copy, and filters
- Add src/_data/site.js and src/_data/pages.js data layer (reads existing config.json files)
- Add src/_includes/base.njk layout (converted from index-template.html)
- Add 21 Nunjucks block templates in src/_includes/blocks/
- Add src/pages.njk pagination template to generate all pages
- Add .eleventyignore to exclude non-template source dirs
- Update package.json: replace gulp/handlebars deps with @11ty/eleventy, update scripts
- Delete gulpfile.js (no longer needed with Eleventy)
- Delete all 22 Handlebars templates in src/templates/
- These have been replaced by Nunjucks templates in src/_includes/
- Move all non-generated content (Demos/, Scenes/, css/, js/, playground/,
  sandbox/, viewer.html, etc.) from build/ to static/ at project root
- Configure Eleventy passthrough copy to output static/ contents to build root
- Add build/ to .gitignore (build output should not be tracked)
- build/ was previously removed from git tracking via git rm --cached
…itecture

# Conflicts:
#	build/community/index.html
#	build/metaverse/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant