https://github.com/seangenabe/docpad-plugin-generationmessage
Immediately send back a custom response while generation has not yet been performed.
https://github.com/seangenabe/docpad-plugin-generationmessage
Last synced: 4 months ago
JSON representation
Immediately send back a custom response while generation has not yet been performed.
- Host: GitHub
- URL: https://github.com/seangenabe/docpad-plugin-generationmessage
- Owner: seangenabe
- License: other
- Created: 2014-05-19T06:29:01.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T13:06:15.000Z (over 8 years ago)
- Last Synced: 2025-03-19T19:51:21.702Z (7 months ago)
- Language: CoffeeScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Generation message plugin for [DocPad](http://docpad.org)
Immediately send back a custom response while generation has not yet been performed.
## Install
```
docpad install generationmessage
```## Configure
```
plugins:
generationmessage:
generationMessageFile: '503-generation.html' # The path to the generation file.
```## Creating a generation message file
You can create a generation message file named "503-generation.html" under your documents or your files folder.
You _can_ create a multi-extension document, such as "503-generation.html.jade", but:
* You will need to specify its path in the configuration.
* You can't use any template helpers as they're not guaranteed to be available at the time the file will be rendered.## Notes
* I created this plugin so that while the website is generating, Heroku's router won't time out and we can give a meaningful response to visitors.
* Most of the time it will still take time before the website will respond with the generation message due to DocPad's synchronous nature. To solve this, I imagine we would need to put several setImmediate calls to DocPad or TaskGroup, but that is outside the scope of this plugin.