Skip to content
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 post hook on site generation #47

Closed
ofZach opened this issue Aug 19, 2013 · 10 comments
Closed

Add post hook on site generation #47

ofZach opened this issue Aug 19, 2013 · 10 comments

Comments

@ofZach
Copy link

ofZach commented Aug 19, 2013

I would find it useful to have a post hook after the site is generated, especially with the watch functionality where the site is generated on every change (which is very useful!). for example, a script could open or refresh a browser window or call sync files, etc.

@spf13
Copy link
Contributor

spf13 commented Aug 19, 2013

This should be easy enough to add. We should add a prehook and a posthook
option to the config and command line.

I could take a stab at it in a couple days.

@spf13
Copy link
Contributor

spf13 commented Aug 20, 2013

Thinking about this a bit more it should actually be a set of hooks that can be defined in the config. You should provide an optional extension, optional path and command to run. This should cover all bases for anything anyone would would as far as I can think of.

It covers the javascript compression case, the coffeescript case, the scss/sass case.

You could run an image compression or even push something to a remote server.

Probably the best way to do this is that the command would specify something like %file% in places where they would want the single changed file to be in the command.

Does this sound like it would work for everyone?

@redalastor
Copy link

Can I have different hooks when I run it as a server and when I package the site?

@redalastor
Copy link

When in server mode, I'd simply start compass watch or whatever_i_am_using watch.

It'd be nice I could start them as pre commands and have them killed when I kill the server.

@spf13 spf13 modified the milestones: v0.13, v0.14 Feb 22, 2015
@anthonyfok anthonyfok modified the milestones: v0.15, v0.14 Sep 16, 2015
@anthonyfok anthonyfok modified the milestones: v0.16, v0.15 Nov 30, 2015
@moorereason moorereason modified the milestones: future, v0.16 May 7, 2016
@bep bep changed the title post hook on site generation Add post hook on site generation Jul 21, 2016
@bep
Copy link
Member

bep commented Jul 21, 2016

@spf13 you said back in 2013 that you would "take a stab at it in a couple days". Now it is more than a few days later; what is the status?

@bep
Copy link
Member

bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep
Copy link
Member

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep bep removed the Stale label Apr 9, 2017
@stale
Copy link

stale bot commented Dec 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Dec 6, 2017
@stale stale bot closed this as completed Dec 27, 2017
moorereason pushed a commit to moorereason/hugo that referenced this issue Sep 13, 2019
Add environment arguments and improve testing
@benyanke
Copy link

I would love to have this feature for a unique usecase of mine - along with pre-build hooks too.

Has there been any interest in this lately, or would you still be open to it, @bep and/or @spf13 ?

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants