Skip to content

Add post hook on site generation #47

Description

@ofZach

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.

Activity

  1. spf13 commented on Aug 19, 2013

    @spf13
    Contributor

    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.

  2. spf13 commented on Aug 20, 2013

    @spf13
    Contributor

    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?

  3. redalastor commented on Aug 22, 2013

    @redalastor

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

  4. redalastor commented on Aug 22, 2013

    @redalastor

    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.

  5. modified the milestones: v0.13, v0.14 on Feb 22, 2015
  6. modified the milestones: v0.15, v0.14 on Sep 16, 2015
  7. modified the milestones: v0.16, v0.15 on Nov 30, 2015
  8. modified the milestones: future, v0.16 on May 7, 2016
  9. changed the title [-]post hook on site generation[/-] [+]Add post hook on site generation[/+] on Jul 21, 2016
  10. bep commented on Jul 21, 2016

    @bep
    Member

    @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?

  11. bep commented on Feb 28, 2017

    @bep
    Member

    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.

  12. bep commented on Mar 1, 2017

    @bep
    Member

    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.

  13. stale commented on Dec 6, 2017

    @stale

    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.

  14. added a commit that references this issue on Sep 13, 2019
  15. benyanke commented on Jan 28, 2022

    @benyanke

    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 ?

  16. github-actions commented on Feb 4, 2022

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions