-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hook system to Tarbell commands #37
Comments
Added to beta-4 milestone. @rnagle is assigned but we need @alexbordens @aepton @hbillings and the whole team's input ... |
Tarbell smooshes together _base/base.py and tarbell_config.py when previewing or building a project. So it seems simple enough to be able to declare hooks in both of those files. Before we get into more of the mechanics, here's key the hooks I think we need:
My current best guess at what this should look like is that there should be a base or tarbell_config:
tarbell_config:
|
Paging @rnagle paging @hbillings I need feeeedback on this... I even have a good use case right now from a current internal project. When publishing to s3, we need to iterate over content in the spreadsheet and for each row (which represents an element in a listicle) create a stub page, a redirect on amazon s3, and finally ping the Facebook opengraph debugger so that each item can be shared individually and seamlessly. |
This sounds logical to me. Question: Why in both tarbell_config and in _base? Just so you can add your own in tarbell_config? Or only enable the ones you want to use? |
That's an excellent question. One reason would simply be being consistent -- there's a common try tarbell_config.py -> fall back to base.py pattern in Tarbell. You pretty much answered your own question -- I think a good architecture is:
|
Creating of a
~/.tarbell/hooks.py
file that can accomodate pre/post command hooks to run (e.g. to allow custom linting on site generation or custom repo setup on new project creation).The text was updated successfully, but these errors were encountered: