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 build callbacks to Builder plugins and allow arbitrary instantiation #422

Merged
merged 3 commits into from Oct 17, 2021

Conversation

jaredcwhite
Copy link
Member

Resolves #421

This also changes the behavior of the resource_data_for_id method builders can provide — before it was a class method, which meant no access to instance methods or variables. Now it can be an instance method. For example:

class ResourceData < SiteBuilder
  def resource_data_for_id(id)
    { title: "Here's data!" } if id == "builder://ResourceData/my_page.html"
  end
end

@render
Copy link

render bot commented Oct 16, 2021

@render
Copy link

render bot commented Oct 16, 2021

@jaredcwhite jaredcwhite merged commit f7f9d14 into main Oct 17, 2021
@jaredcwhite jaredcwhite deleted the add-callbacks-to-builders branch October 17, 2021 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decouple Builder initialization from running the build method
1 participant