-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are three new extension hooks in place now: * before_extensions + All extensions added via this method, following the same extension rules, will be run before any other extensions loaded with `extension`. * after_extensions + All extensions added via this method, following the same extension rules, will be run after any other extensions loaded with `extension`. * after_generation + All extensions added via this method, following the same extension rules, will be run after the page generation is completed. This will only run on the first generation, not on reloads. Extensions will now be notified if they are being reloaded. To be notified of this an extension must have an `on_reload(site)` method, which will be called if there is a change. An extension is then free to re-run an initialization logic, clean-up the site variable, or create new state needed for a re-run of the `execute(site)` method.
- Loading branch information
1 parent
782bddd
commit d12d8e4
Showing
6 changed files
with
143 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Awestruct | ||
module Test | ||
module Extensions | ||
class TestBeforeExtension | ||
def execute site | ||
end | ||
end | ||
|
||
class TestAfterExtension | ||
def execute site | ||
end | ||
end | ||
|
||
class TestAfterGenerationExtension | ||
def execute site | ||
end | ||
end | ||
|
||
class LinkTransformer | ||
def transform site, page, content | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'support/test-data/pipeline/_ext/extensions' | ||
|
||
Awestruct::Extensions::Pipeline.new do | ||
before_extensions Awestruct::Test::Extensions::TestBeforeExtension.new | ||
extension Awestruct::Extensions::Indexifier.new | ||
after_extensions Awestruct::Test::Extensions::TestAfterExtension.new | ||
helper Awestruct::Extensions::Relative | ||
transformer Awestruct::Test::Extensions::LinkTransformer.new | ||
after_generation Awestruct::Test::Extensions::TestAfterGenerationExtension.new | ||
end | ||
|