**Update: I haven't been using Phlex on any real-world projects and haven't seen any real demand for it in Bridgetown circles, so I've decided to archive this (unreleased) plugin. Happy to revisit down the road if demand increases.
A Bridgetown plugin for rendering Phlex components.
Run this command to add this plugin to your site's Gemfile:
bundle add phlextown
Then add the initializer to your configuration in config/initializers.rb
:
init :phlextown
Then you can start writing Phlex components in the src/_components
folder by subclassing Phlex::HTML
. You can also use the phlex
helper in Ruby templates (.rb
, ERB, Serbea, etc.) for rendering Phlex templates directly inside of page templates.
In your Phlex component you can use the helper
method to access Bridgetown helpers, such as markdownify
. You can also render other Bridgetown components from your Phlex templates, including Liquid components via liquid_render
.
- Run
bundle exec rake test
to run the test suite - Or run
script/cibuild
to validate with Rubocop and Minitest together.
- Fork it (https://github.com/bridgetownrb/phlextown/fork)
- Clone the fork using
git clone
to your local development machine. - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request