You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the life of me, I can't figure out where usage of hooks go when working with them directly. A proper example would be greatly helpful here. If they belong in the initializer or a config. I figured it would be nice to have a hooks.rb file in the config folder, but I was unsuccessful in getting that to work.
The "inflector" loaded in from Rails' ActiveSupport is used to convert between singular and plural collection names automatically. If you need to customize the inflector with words it doesn't specifically recognize, create a plugin and add your own:
```ruby
ActiveSuport::Inflector.inflections(:en) do |inflect|
inflect.plural /^(ox)$/i, '\1\2en'
inflect.singular /^(ox)en/i, '\1'
end
```
The text was updated successfully, but these errors were encountered:
@jclusso Thanks for calling this out. Part of the issue I think is I really dislike that hooks API, as it's a holdover from Jekyll days, and I've been trying to move away from it in various ways. I'm realizing now there's not adequate documentation on how to use hook in initializer files, which is the new preferred way to define hooks going forward outside of a Builder. It needs updating here: https://www.bridgetownrb.com/docs/configuration/initializers
For the life of me, I can't figure out where usage of hooks go when working with them directly. A proper example would be greatly helpful here. If they belong in the initializer or a config. I figured it would be nice to have a hooks.rb file in the config folder, but I was unsuccessful in getting that to work.
bridgetown/bridgetown-website/src/_docs/plugins/hooks.md
Lines 24 to 28 in 6ff7de5
This also leads me to having no idea how to get inflections to work. I think a full example showing where and what hook it should use would be great.
bridgetown/bridgetown-website/src/_docs/resources.md
Lines 248 to 255 in 6ff7de5
The text was updated successfully, but these errors were encountered: