Commit Graph

22 Commits

Author SHA1 Message Date
Liam Cooke
eac6eb25b8 Add post_convert hook to modify HTML content before layout (#8368)
Co-authored-by: John Hughes <johnkhughes@users.noreply.github.com>
2020-09-04 12:31:24 +05:30
Ashwin Maroli
ea57ef78da Simplify Jekyll::Hooks.trigger logic (#8044)
Merge pull request 8044
2020-03-04 10:14:53 -05:00
jekyllbot
a28f54a59f Bump Rubocop to v0.59.0 (#7237)
Merge pull request 7237
2018-09-09 18:14:46 -04:00
Frank Taillandier
6c771608e5 Update Rubocop's config (#7050)
Merge pull request 7050
2018-06-02 06:50:32 -04:00
Jordon Bedwell
aa959cef8a Allow plugins to modify the obsolete files. (#6502)
Merge pull request 6502
2017-10-30 14:54:06 -04:00
Parker Moore
7cf5f51ca2 Enforce Style/FrozenStringLiteralComment. (#6265)
Merge pull request 6265
2017-08-03 21:27:32 -04:00
Anatoliy Yastreb
d3b00cb84c Bump Rubocop to 0.49.1 (#6093)
Merge pull request 6093
2017-06-15 08:29:35 -04:00
Pat Hawks
1d885911bc Rubocop: Require consistent comma in multiline literals 2017-01-12 17:52:29 -06:00
jekyllbot
6847b604c8 Merge pull request #5157 from stevecheckoway/fix-hooks-priority-order
Merge pull request 5157
2016-09-28 16:39:44 -07:00
Pat Hawks
3bfdc00d14 Appease Rubocop 2016-09-19 13:15:02 -05:00
Stephen Checkoway
6167c09569 Run hooks in priority order.
Low priority hooks are being run before higher priority hooks. This is easy to
demonstrate with the following plugin:

    1.upto(10).each do |n|
      Jekyll::Hooks.register :site, :after_reset, priority: Jekyll::Hooks::PRIORITY_MAP[:low] do
        puts "Low #{n}"
      end
      Jekyll::Hooks.register :site, :after_reset, priority: Jekyll::Hooks::PRIORITY_MAP[:normal] do
        puts "Normal #{n}"
      end
      Jekyll::Hooks.register :site, :after_reset, priority: Jekyll::Hooks::PRIORITY_MAP[:high] do
        puts "High #{n}"
      end
    end

Sorting by the negative of the priority and then by the order the hook was
added does the right thing.
2016-08-06 20:56:34 -05:00
Pat Hawks
a8d27e5788 Rubocop: Low hanging fruit 2016-05-23 22:10:49 -05:00
Parker Moore
84b7d9b3ac Add Hook for :site :after_init 2016-03-23 13:14:08 -07:00
Pat Hawks
13c980c896 Rubocop: Style/TrailingComma 2016-01-04 11:08:31 -08:00
Pat Hawks
2530a8cdfc Rubocop: Style/HashSyntax
- Use hash rockets syntax
2016-01-03 15:49:22 -08:00
Pat Hawks
0eae36aec2 Rubocop: Style/LineEndConcatenation
- Use \ instead of + or << to concatenate those strings
2016-01-03 14:41:49 -08:00
Will Norris
1bfe5a6f95 align hooks documentation and implementation
- add site post_render hook, which was documented but wasn't being
  called
- define documents post_init hook, which was documented but caused an
  error when called (fixes #4102)
- add docs for site post_read hook, which was being called but wasn't
  documented
- fix container name in example: s/post/posts/
2015-11-03 07:47:32 -08:00
Parker Moore
b89f943bf2 collections: posts as collection 2015-10-26 00:29:14 -07:00
Stephen Crosby
7c4f319442 #3870 trigger hooks by owner symbol 2015-07-27 16:23:07 -07:00
Stephen Crosby
736e6a78f1 address code review feedback from #3553
- change site:reset to site:after_reset
- raise an exception when registering uncallable hook
- set default hook priority at the public API level
2015-05-02 15:56:19 -07:00
Stephen Crosby
245d9677d7 Refine hook implementation
- hooks are registered to symbol owners rather than classes directly
- during registration, add the ability to specify owner as an array to
  register the same hook to multiple owners
- add optional priority during registration as a symbol (:low, :normal,
  :high)
- implement hooks for collections as they are in octopress-hooks, aside
  from post_init
2015-05-01 19:00:37 -07:00
Stephen Crosby
6ca9633354 prototype of jekyll hooks, encapsulated 2015-05-01 14:35:15 -07:00