Skip to content

Commit

Permalink
docs fixes and additions
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 10, 2019
1 parent 96ad00f commit 2341a83
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Besides the classic pagination offered by the `pagy_nav` helpers, you can use a

- [pagy_nav_js](http://ddnexus.github.io/pagy/extras/navs#javascript-navs): A faster and lighter classic looking UI, rendered on the client side with optional responsiveness:<br>![bootstrap_nav_js](docs/assets/images/bootstrap_nav_js-w.png)

- [pagy_combo_nav_js](http://ddnexus.github.io/pagy/extras/navs#javascript-combo-navs): The fastest and lighest alternative UI that combines navigation and pagination info in a single compact element:<br>![bootstrap_combo_nav_js](docs/assets/images/bootstrap_combo_nav_js-w.png)
- [pagy_combo_nav_js](http://ddnexus.github.io/pagy/extras/navs#javascript-combo-navs): The fastest and lightest alternative UI _(48x faster, 48x lighter and 2,270x more efficient than Kaminari)_ that combines navigation and pagination info in a single compact element:<br>![bootstrap_combo_nav_js](docs/assets/images/bootstrap_combo_nav_js-w.png)

## Resources

Expand Down
4 changes: 3 additions & 1 deletion docs/extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ A few helpers use javascript, and they are clearly recognizable by the `js` suff

If you use any of them you should load the [pagy.js](https://github.com/ddnexus/pagy/blob/master/lib/javascripts/pagy.js) file, and run `Pagy.init()` on window load and eventually on [AJAX-load](#using-ajax-with-javascript-enabled-helpers).

**CAVEATS**: if you override any `*_js` helper, ensure to override/enforce the relative javascript function, even with a simple copy and paste. If the relation between the helper and the function changes in a next release (e.g. arguments, naming, etc.), your app will still work with your own overriding even without the need to update it.
**CAVEATS**
- If you override any `*_js` helper, ensure to override/enforce the relative javascript function, even with a simple copy and paste. If the relation between the helper and the function changes in a next release (e.g. arguments, naming, etc.), your app will still work with your own overriding even without the need to update it.
- See also [Preventing crawlers to follow look-alike links](how-to.md#preventing-crawlers-to-follow-look-alike-links)

### Add the oj gem

Expand Down
11 changes: 11 additions & 0 deletions docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,17 @@ If you don't have strict requirements but still need to give the user total feed
If your requirements allow to use the `countless` extra (minimal or automatic UI) you can save one query per page, and drastically boost efficiency eliminating the nav info and almost all the UI. Take a look at the examples in the [support extra](extras/support.md).
## Preventing crawlers to follow look-alike links
The `*_js` helpers come with a JSON tag including a string that looks like an `a` link tag. It's just a placeholder string used by `pagy.js` in order to create actual DOM elements links, but some crawlers are reportedly following it even if it is not a DOM element. That causes server side errors reported in your log.

You may want to prevent that by adding the following to your `robots.txt` file:

```
User-agent: *
Disallow: *__pagy_page__
```
## Handling Pagy::OverflowError exceptions
Pass an overflowing `:page` number and Pagy will raise a `Pagy::OverflowError` exception.
Expand Down

0 comments on commit 2341a83

Please sign in to comment.