NOTE: This isn't a real plugin! Copy this sample code and use it to create your own Ruby gem! Help guide here… 😃
You can run bridgetown plugins new to easily set up a customized version of this starter repo.
A Bridgetown plugin to [fill in the blank]…
Run this command to add this plugin to your site's Gemfile:
bundle add my_awesome_pluginThen add the initializer to your configuration in config/initializers.rb:
init :my_awesome_pluginOr if there's a bridgetown.automation.rb automation script, you can run that instead for guided setup:
bin/bridgetown apply https://github.com/username/my_awesome_pluginThe plugin will…
The plugin will automatically use any of the following metadata variables if they are present in your site's _data/site_metadata.yml file.
…
- Run
bundle exec rake testto run the test suite - Or run
script/cibuildto validate with Rubocop and Minitest together.
- Fork it (https://github.com/username/my-awesome-plugin/fork)
- Clone the fork using
git cloneto 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
To release a new version of the plugin, simply bump up the version number in both version.rb and
package.json, and then run script/release. This will require you to have a registered account
with both the RubyGems.org and NPM registries.
You can optionally remove the package.json and frontend folder if you don't need to package frontend
assets.
If you run into any problems or need further guidance, please check out our Bridgetown community resources where friendly folks are standing by to help you build and release your plugin or theme.
To publish a gem publicly and have it included in Bridgetown's official Plugin Directory, use this guide to get started!