Skip to content

Drupal-Quick/drupal-quick

Repository files navigation

Quick

A Composer package that scaffolds a new Drupal site from a single config file. Run it once to get a working site with a generated custom theme and your chosen recipes applied, then remove it — no long-term dependency on the project.

Work in progress. The bundled theme and recipe are proofs of concept; the core workflow is functional.


How it works

After creating your Drupal project (composer create-project drupal/recommended-project my-site), the build is three commands driven by config.dq.yml:

# Until tagged releases are on Packagist, register the package repos + allow dev:
composer config minimum-stability dev && composer config prefer-stable true
composer config repositories.drupal-quick vcs https://github.com/Drupal-Quick/drupal-quick
composer config repositories.dq_starterkit vcs https://github.com/Drupal-Quick/dq-starterkit
composer require "drupal-quick/drupal-quick:dev-main" drush/drush

composer exec dq-init        # write config.dq.yml (--interactive for a wizard)
# edit config.dq.yml
composer exec dq-install     # fetch any registry recipe packages
drush dq:scaffold            # install Drupal, generate theme, apply recipes, build assets

When the site is built, remove Quick — the tool deletes its own code, leaving a self-contained project:

drush dq:cleanup             # archive config.dq.yml (commented) + remove the package
drush dq:cleanup --purge     # delete config.dq.yml instead of archiving

With DDEV

Run every command through ddev so it executes in the web container (PHP, Composer, Node/npm, and a database all provided). For the full step-by-step walkthrough including static export and deploy, see docs/workflow.md.

mkdir my-site && cd my-site
ddev config --project-type=drupal --docroot=web --nodejs-version=20
ddev start
ddev composer create-project drupal/recommended-project .

# Until tagged releases are on Packagist, register the package repos + allow dev:
ddev composer config minimum-stability dev && ddev composer config prefer-stable true
ddev composer config repositories.drupal-quick vcs https://github.com/Drupal-Quick/drupal-quick
ddev composer config repositories.dq_starterkit vcs https://github.com/Drupal-Quick/dq-starterkit
ddev composer require "drupal-quick/drupal-quick:dev-main"

ddev composer exec -- dq-init     # add --interactive and/or --ddev after `--`
ddev composer exec -- dq-install
ddev drush dq:scaffold

--nodejs-version=20 gives the container a recent Node for the Vite build; set theme.build: false to skip it. Pass --ddev to dq-init to drop in DDEV deploy-credential templates for dq:deploy.


config.dq.yml

site:
  name: "My Site"
  admin_user: "admin"
  # Omit admin_pass to have a strong password generated and shown once.

theme:
  machine_name: "my_theme"
  title: "My Theme"
  preset: "minimal"      # a design preset from the starterkit (presets/)
  layout: "sidebar"      # page shell baked at scaffold: sidebar | single
  build: true            # false to skip the npm build

recipes:
  - "core/recipes/standard"
  - name: "blog"         # short key from the recipe registry
    options:             # optional — the recipe's own inputs (defaults apply)
      items_per_page: 10

# homepage:              # optional — compose the front page from recipe blocks
#   blocks:
#     - "blog/recent"

parameters:
  theme_design:
    primary_color: "#10b981"
    secondary_color: "#1e3a8a"
    font_family: "'Inter', sans-serif"
  recipe_config:
    "system.site":
      slogan: "Built with Quick."

static:                  # optional, used by `drush dq:static`
  target: "netlify"      # netlify | github | none
  uri: "https://example.com"

What you get

  • A custom theme at web/themes/custom/{machine_name}/, generated from dq_starterkit and built with Vite + Tailwind CSS v4.
  • Your chosen design preset (colors, type, optional fonts) plus theme_design overrides applied to the theme — swap it anytime with npm run preset <name> — and your chosen page layout (sidebar | single), baked into the theme's shell template (templates/includes/page-shell.html.twig), which is yours to edit from then on.
  • Recipe templates merged into the theme and recipe behaviour assembled as native OOP-hook submodules; all recipes applied in order against a minimal install, each with its options: passed as native recipe inputs.
  • Optionally a composed homepage: recipe-advertised blocks placed in your order on a dedicated /home front page — ordinary block config you can rearrange later.
  • Module-free Schema.org JSON-LD on content pages (BlogPosting for articles, WebPage for pages), built from each node's own fields.

Static export

drush dq:static installs Tome and exports the site to static HTML in html/. drush dq:deploy then writes the deploy config for the chosen static.target (Netlify or GitHub Pages) and publishes it (Netlify automated, needs CLI auth). Settings persist to Drupal config so they survive dq:cleanup. Full workflow and caveats in docs/static-deploy.md.


Requirements

PHP 8.1+ · Drupal 11.3+ (tested on 11.3 and 11.4 — the scaffold auto-detects 11.4's consolidated dr CLI) · Drush 12.5+ · Node.js/npm (for the theme build)


Tests

Unit tests cover the pure logic in src/ (config normalization, option injection, preset discovery, registry building) — no Drupal site required:

composer install
composer test

Roadmap

  • Build out the recipe library beyond the blog proof of concept.
  • User-extensible starterkits and recipes without editing vendor/ — design in docs/extensibility.md.
  • Harden static export and consider a recipe form — see docs/static-deploy.md.

About

A Composer package that scaffolds a static Drupal site from a single config file, ready for deploy. Integrates recipes and theme starterkits

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages