| title | description | category | type | audience | date |
|---|---|---|---|---|---|
Project Overview |
WordPress block theme scaffold with comprehensive documentation |
Project |
Index |
Developers, Users |
2025-12-01 |
A block based these for the MA society
A modern WordPress block theme supporting Full Site Editing (FSE), built with mustache templates for rapid development and deployment.
- Full Site Editing (FSE) support with block templates
- Mustache template system for dynamic configuration
- Block patterns and template parts
- Style variations (e.g., dark mode)
- Modern asset pipeline with Webpack
- Automated testing (PHP, JS, CSS, E2E)
- CI/CD workflows
- GitHub Copilot integration
- Follows WordPress coding standards
- WordPress 6.5 or higher
- PHP 8.0 or higher
- Node.js 18+
- npm 9+
- Composer (for PHP dependencies)
-
Clone this repository:
git clone https://github.com/LightSpeed/ma-theme cd ma-theme -
Install dependencies:
npm install composer install
-
Build assets:
npm run build
- Upload the theme files to
/wp-content/themes/ma-themeor install via WordPress admin. - Activate the theme in the 'Appearance' screen.
- Customize theme settings in the Site Editor.
This theme follows WordPress coding standards and best practices.
git clone https://github.com/LightSpeed/ma-theme
cd ma-theme
npm install
composer install
npm run startThis theme uses @wordpress/scripts for a modern build workflow:
- Compilation: Modern JavaScript (ESNext/JSX) → Browser-compatible code via Babel
- Bundling: Multiple files combined into optimized bundles via webpack
- Sass Compilation:
.scssfiles compiled to standard CSS - Code Minification: JavaScript (Terser) and CSS (cssnano) optimization
- Code Linting: ESLint for JavaScript, Stylelint for CSS
- Code Formatting: Prettier for consistent styling
Documentation:
- 📖 Build Process Guide - Complete build documentation
- 📖 wp-scripts Configuration - Detailed setup guide
- 📖 Quick Reference - Common tasks and commands
- 📖 Summary - Configuration summary
npm run start- Start development mode with hot reloading and watch modenpm run build- Build optimized production assetsnpm run build:production- Alternative production build
npm run lint- Run all linters (JavaScript, CSS, PHP)npm run lint:js- Lint JavaScript filesnpm run lint:js:fix- Auto-fix JavaScript issuesnpm run lint:css- Lint CSS/Sass filesnpm run lint:css:fix- Auto-fix CSS issuesnpm run lint:php- Lint PHP filesnpm run format- Format all files with Prettier
npm run test- Run all tests (JavaScript + PHP)npm run test:js- Run JavaScript unit testsnpm run test:js:watch- Run Jest in watch modenpm run test:php- Run PHP unit testsnpm run test:e2e- Run end-to-end tests with Playwright
npm run makepot- Generate translation POT filenpm run makejson- Generate JSON translation filesnpm run i18n- Complete i18n workflow (makepot + makejson)
ma-theme/
├── .github/ # GitHub workflows and automation
├── assets/ # Source assets (images, fonts, etc.)
├── inc/ # PHP includes and functionality
├── parts/ # Template parts (header, footer, etc.)
├── patterns/ # Block patterns
├── src/ # Source files for build process
│ ├── css/ # SCSS/CSS source files
│ └── js/ # JavaScript source files
├── styles/ # Style variations
├── templates/ # Block templates
├── tests/ # Test files
├── public/ # Built assets (auto-generated)
├── functions.php # Theme functions
├── style.css # Main stylesheet with theme metadata
├── theme.json # Theme configuration
├── package.json # Node.js dependencies and scripts
├── composer.json # PHP dependencies
├── webpack.config.js # Webpack configuration
└── README.md # This file
This theme uses mustache templates for easy customization. Key variables include:
Medical Academic- Display name of the themema-theme- URL-safe theme identifierA block based these for the MA society- Theme descriptionLightSpeed- Theme author namehttps://lightspeedwp.agency- Author website URL#0073aa- Primary brand color#005177- Secondary color#ffffff- Background color#1a1a1a- Text color{{body_font}}- Body font family
Excluding files from mustache scanning:
The mustache variable scanner respects a .mustacheignore file at the repository root. Use this to exclude files or directories from variable detection:
# Copy the example file
cp .mustacheignore.example .mustacheignore
# Edit to add custom patterns
# Patterns use gitignore syntax (glob patterns)Common exclusions:
- Build artifacts (
build/**,dist/**) - Dependencies (
node_modules/**,vendor/**) - Test fixtures (
tests/fixtures/**) - Generated files
Edit theme.json to customize:
- Color palette
- Typography settings
- Spacing scale
- Layout settings
- Create new pattern files in the
patterns/directory - Register patterns in
inc/block-patterns.php - Add pattern categories as needed
- JavaScript: Jest unit tests with coverage
- Script helpers: The scripts/
__tests__/helpers are driven bynpm run test:scripts(ornpm run test:scripts:coverage) from the repo root, emit V8 coverage for<rootDir>/scripts/**/*.js, and drop every artifact (includingcoverage/scripts/lcov.info) intocoverage/scriptsso new helper modules stay part of the reports. - PHP: PHPUnit tests with WordPress testing framework
- End-to-End: Playwright tests
- Accessibility: Automated a11y testing with axe-core
- Performance: Lighthouse CI and Core Web Vitals monitoring
- Coverage: Codecov integration with quality gates
This scaffold includes a complete Docker-based development environment:
- Open in VS Code with the Dev Containers extension
- Reopen in Container when prompted
- Services included:
- WordPress (port 8080)
- MariaDB (port 3306)
- phpMyAdmin (port 8081)
- MailHog (port 8025)
# Or manually start the environment
cd .devcontainer && docker-compose up -dAutomated workflows handle:
- Linting & Testing - On every push/PR
- Security Audits - Dependency vulnerability checks
- E2E Tests - Playwright browser testing
- Code Coverage - JavaScript & PHP coverage with Codecov
- Bundle Analysis - Size tracking and quality gates
- Releases - Automated version bumping and changelog
- WordPress.org Deploy - Theme directory deployment on release
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
npm run lint && npm test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Contributing Guidelines for more details.
Comprehensive documentation is available in the docs/ directory:
- Build Process - Complete build system guide
- Testing Guide - Running and writing tests
- Internationalization - i18n and translation guide
- Tool Configuration - Linting, formatting, and build tools
- Agents Guide - AI agents and automation
- Workflows Guide - CI/CD workflows documentation
- API Reference - Theme API documentation
- Performance - Performance optimization guide
- Security - Security best practices
Configuration Documentation (docs/config/):
- wp-scripts - Complete @wordpress/scripts guide
- Webpack - Bundling configuration
- Babel - JavaScript compilation
- ESLint - JavaScript linting
- Stylelint - CSS/Sass linting
- PostCSS - CSS processing
- Jest - Unit testing
- Playwright - E2E testing
- Prettier - Code formatting
- Issues: GitHub Issues
- Community: WordPress.org Support
This theme is licensed under the GPL-2.0-or-later - see the LICENSE file for details.
See CHANGELOG.md for a complete list of changes.
Medical Academic | v1.0.0 | GPL-2.0-or-later