Project

pagy-govuk

0.0
The project is in a healthy, maintained state
A Pagy Extra that renders GOV.UK pagination
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 8.5
 Project Readme

Pagy::GovukExtra

Provides a pagy_govuk_nav method that is a drop-in replacement for pagy_nav, using the same Pagy "extras" pattern that already serves Bootstrap, Bulma et al

Installation

gem install pagy-govuk

Usage

  # in your setup, e.g. config/initializers/pagy.rb for a Rails app
  require 'pagy/extras/govuk'
  # Adds default GOV.UK SVG arrows and aria labels. 
  # Override these pagy keys using this gem's en.yml as a template.
  Pagy::GovukExtra.add_default_i18n_load_path 

  # in your controller, assign a pagy instance as normal
  def index
    @pagy, @posts = pagy(BlogPost.all, items: 10)
  end

  # in your view
  <%= pagy_govuk_nav(@pagy).html_safe %>

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rgarner/pagy-govuk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Pagy::Govuk project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.