Skip to content

Instantly share code, notes, and snippets.

@zoul
Last active May 17, 2018 15:21
Show Gist options
  • Save zoul/7579150 to your computer and use it in GitHub Desktop.
Save zoul/7579150 to your computer and use it in GitHub Desktop.
Posts a message to the OS X notification center when a Jekyll build is finished. Requires TerminalNotifier, see http://git.io/5X99Eg or “gem install terminal-notifier”.
begin
require 'terminal-notifier'
module Jekyll
class Site
alias jekyll_process process
def process
jekyll_process
TerminalNotifier.notify('Jekyll rebuild finished.')
end
end
end
rescue LoadError
# nothing
end
@chriddyp
Copy link

Amazing! Does this work for the regenerating watcher, jekyll serve?

@chriddyp
Copy link

It does indeed! Fantastic! Thank you!
image

For folks discovering this on google, add this plugin to your project by saving it inside your _plugins folder.

@nimf
Copy link

nimf commented Jan 23, 2016

Thank you!
I've updated this gist to report build errors also: https://gist.github.com/nimf/8637eb8ba68f9134014b

@johnpitchko
Copy link

Hmm placed this file in my _plugins/ directory but does not seem to be generating any notifications. I installed terminal-notifier via home-brew.

@lukeemmerson-finch
Copy link

Hey, anyone know how to get this to work with Jekyll V3.8.1 and terminal notifier 2.0.0? They appear to have stopped speaking to one another. I can manually trigger terminal notifier, so i suspect it's this plugin code that needs updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment