DocPad is great.... but so is Grunt. Use grunt-contrib-connect and grunt-contrib-watch instead of docpad's server and watcher.
This example shows a Grunt-based build workflow that replaces DocPad’s built-in server and watcher with grunt-contrib-connect and grunt-contrib-watch, enabling live-reload during static site generation. The configuration defines a `docpad` task that watches `src/**/*.*` files and triggers a shell command to regenerate output into the `out` directory, while a separate watch task monitors `out/**/*` for live-reload. The `connect` server serves the generated `out` folder on port 9778 with livereload enabled, and tasks like `generate`, `server`, and `run` orchestrate clean builds and continuous development. The code relies on Grunt’s task registry, `grunt-shell`, `grunt-contrib-watch`, `grunt-contrib-connect`, and `grunt-contrib-clean` to handle file watching, HTTP serving, and cleanup.
AI-generated description