# DocPad

{% embed url="<https://www.youtube.com/embed/hvQCXDWh7Wg?list=PLYVl5EnzwqsQs0tBLO6ug6WbqAbrpVbNf>" %}
Watch the talk that launched DocPad into publicity
{% endembed %}

{% hint style="info" %}
DocPad lead the static-site-generator wave throughout 2011 until 2014, and I am proud of my investment's accomplishments during that time. However despite lingering users and a dark age of prolonged unpaid maintenance, these days it should be considered archived for the history books. It could not keep up with the competitive landscape in a way that provided return for investment, especially when considering the sunken ship of opportunity cost of the time that was invested into it.

DocPad's final releases were devoted to wrap up the project with a nice bow, and to admit its mistakes. Something which in hindsight, was also a mistake — an abrupt end would have been a better investment of time — unfortunately my conscience required closure to move on.

These are the summaries of DocPad's final hurrah:

* [v6.79](https://github.com/docpad/docpad/blob/master/HISTORY.md#v6794-2017-march-31) was the last release to support legacy plugins
* [v6.80](https://github.com/docpad/docpad/blob/master/HISTORY.md#v6800-beta-2018-march-7) incorporated many years of ecosystem upgrades, increased performance, solved many long-standing issues, removed all non-vital server communication, and dropped support for legacy plugins
* [v6.81](https://github.com/docpad/docpad/blob/master/HISTORY.md#v6810-2018-august-21) removed the dynamic abilities from DocPad which was an innovative feature of DocPad at the time but it grew to become better served by newer tooling such as Next and Nuxt
* [v6.82](https://github.com/docpad/docpad/blob/master/HISTORY.md#v6820-2018-september-7) made many refinements and fixed many long-standing issues
* [v6.83](https://github.com/docpad/docpad/blob/master/HISTORY.md#v6830-2020-august-5) removed the last cloud code, and updated the Bevry packages for massive peformance improvements

These days you are better served by either:

* The [un-staticsitegenerators](https://github.com/bcomnes/bret.io/blob/3bf02ba6572cc6ff9919ab3de95a03e5dcb7dfdc/package.json#L6-L28) concept, which is using a collection of independent [unix-style](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well) commands composed into a completely customisable and interchangeable build system with only 20 lines of code.
* Frameworks like [Sapper](https://sapper.svelte.dev/), [Stencil](https://next.stenciljs.com/), [Next](https://nextjs.org/), [Nuxt](https://nuxtjs.org/).
* Whatever tools that [Headless Content Management Systems](https://alternativeto.net/tag/content-as-a-service/) integrate with.
* Personally, I find [lit-html's](https://lit-html.polymer-project.org) [ecosystem](https://github.com/web-padawan/awesome-lit-html) promising.

For those wanting to write their own static site generators, [here are my learnings](https://medium.com/ephemeral-living/2017s-generation-of-static-site-generators-164c3b7b9f97).

For those wanting to avoid the same time investment mistake, please read [Zero to One](https://www.goodreads.com/book/show/18050143-zero-to-one) — if that book existed earlier, it would have saved me a decade of my life.

With that said, the documentation continues for your lingering curiosity. DocPad should still work, but if it doesn't, you're on your own. Please submit fixes to the documentation if needed.

Regards,\
[Benjamin Lupton](https://balupton.com), Creator of DocPad
{% endhint %}

## What is DocPad?

DocPad takes files on your computer, such as easy to read markdown documents, and then transforms them into static output that can be deployed anywhere.

### Problems with Traditional Web Architectures

Despite all the amazing wonder of current web application architectures, they're mostly:

* **Inherently slow**
  * Usually built on blocking, live-then-die platforms
  * Performance is an afterthought, re-render every single time (by default, caching can be enabled to improve this)
* **Bloated**
  * Huge, include-everything codebase, with little or no code re-use (especially between frameworks)
  * Overkill for everything, as no single project will use every feature of the CMS
* **Complex**
  * Gigantic learning curves, usually measured in months (instead of days or hours)
  * You require CMS/framework developers instead of web developers
* **Difficult**
  * Setting up a new website is time-consuming and complex
  * Uh oh! "database not installed" or "version invalid"
  * Migrations and deployments are a royal pain in the ass
* **Limited**
  * WYSIWYG editors are sucky and stupid - why re-invent the wheel? We're already trained with and love our desktop counterparts (Sublime Text, Vim, Byword, etc.)
  * Abstractions on the go? Forget it - you're boxed in, unless you've got a machete
  * Want to use your own pre-processors, markups, and templating engines? Tough: they're handled by the core.

### DocPad, an intuitive static-site generator

On the other hand, let's compare that with DocPad, which is:

* **Website inherently fast**
  * Built on a non-blocking, stay-alive platform
  * Performance from the ground up, re-render only when changes occur (by default, can be configured differently)
* **Lightweight**
  * Tiny core, with anything that's re-usable abstracted out into modules that other systems can use
  * All non-essential core functionality lives in opt-in plugins
* **Simple**
  * Tiny learning curve; get started in minutes, become a pro in days
  * Web developers already have everything they need to get started
* **Easy**
  * Setting up a new website can be done in minutes
  * In-memory database provides querying without the need for a manual installation
  * Migrations and deployments are handled via Git, the tool we are used to
* **Robust**
  * Use your desktop counterparts to edit content naturally (Sublime Text, Vim, Byword, etc.)
  * Abstraction friendly; code the way you want, how you want
  * Use whatever language, pre-processor, markup, templating engine you want - it's all covered via our [opt-in plugins](https://docpad.bevry.me/community/plugins) (and if it isn't, it's very easy to add)

Besides this, thanks to the opt-in modular philosophy of Node, we benefit from all the innovations of the community as a whole, including:

* [Socket.io](http://socket.io) for realtime communication between the server and client-side
* [Browserify](https://github.com/substack/node-browserify) for being able to share server-side code directly with the client-side
* Native pre-processor rendering such as [CoffeeScript](http://coffeescript.org), [CoffeeKup](http://coffeekup.org), [Stylus](http://learnboost.github.com/stylus/), [LessCSS](http://lesscss.org), etc.

So as the Node community grows and innovates, so do we. Awesome.

### Comparison Table

For those who like tables, here's the above in table form:

| <p><br>Feature</p>                                                  | Usual CMS     | Usual Static Site Generator | DocPad                                                                                                        |
| ------------------------------------------------------------------- | ------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Talent requirements                                                 | CMS developer | Backend+frontend developer  | Frontend developer                                                                                            |
| Developers proficient in                                            | Months        | **Days**                    | **Days**                                                                                                      |
| Plugin and extension system                                         | **Yes**       | No                          | [**Yes**](https://docpad.bevry.me/extend/extend)                                                              |
| Asset pipeline                                                      | No            | Implicit & bundled          | [**Explicit & extendable**](https://docpad.bevry.me/start/overview)                                           |
| Markup languages (markdown, rst, etc.)                              | No            | 1 bundled                   | **Via** [**plugins**](https://docpad.bevry.me/community/plugins)                                              |
| Pre-processors (sass, less, etc.)                                   | No            | No                          | **Via** [**plugins**](https://docpad.bevry.me/community/plugins)                                              |
| Template engines (eco, jade, etc.)                                  | No            | 1 bundled                   | **Via** [**plugins**](https://docpad.bevry.me/community/plugins)                                              |
| Database querying                                                   | **Yes**       | No                          | **Via** [**Query-Engine**](https://github.com/bevry/query-engine)                                             |
| Layouts                                                             | **Yes**       | **Yes**                     | **Yes**                                                                                                       |
| Static website output                                               | No            | **Yes**                     | **Yes**                                                                                                       |
| Re-render each request                                              | Always        | No                          | [**Deprecated**](https://discuss.bevry.me/t/deprecating-in-memory-docpad-importers-exporters/591?u=balupton)  |
| Extend the web server                                               | **Yes**       | No                          | **Via** [**events**](https://docpad.bevry.me/core/events) **and** [**API**](https://docpad.bevry.me/core/api) |
| Watching                                                            | **N/A**       | **Yes**                     | **Yes**                                                                                                       |
| Differential regenerations                                          | **N/A**       | No                          | **Yes**                                                                                                       |
| Live-reload                                                         | No            | No                          | **Via** [**`livereload` plugin**](https://github.com/docpad/docpad-plugin-livereload/)                        |
| Partials                                                            | No            | No                          | **Via** [**`partials` plugin**](https://github.com/docpad/docpad-plugin-partials/)                            |
| Manual database installation required                               | Yes           | **No**                      | **No**                                                                                                        |
| Import pages from file system                                       | No            | **Yes**                     | **Yes**                                                                                                       |
| Import pages from external database (MongoDB, MySQL, etc.)          | **Yes**       | No                          | [**Deprecated**](https://discuss.bevry.me/t/deprecating-in-memory-docpad-importers-exporters/591?u=balupton)  |
| Import pages from external services (Tumblr, Dropbox, GitHub, etc.) | No            | No                          | [**Deprecated**](https://discuss.bevry.me/t/deprecating-in-memory-docpad-importers-exporters/591?u=balupton)  |
| Import data from external services (Atom, XML, JSON, etc.)          | No            | No                          | **Via** [**`feedr` plugin**](https://github.com/docpad/docpad-plugin-feedr/)                                  |
| WYSIWYG editors                                                     | **Yes**       | No                          | [**Deprecated**](https://discuss.bevry.me/t/deprecating-in-memory-docpad-importers-exporters/591?u=balupton)  |
