Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marnen/middleman-breadcrumbs
Breadcrumbs helper for Middleman (http://www.middlemanapp.com)
https://github.com/marnen/middleman-breadcrumbs
Last synced: 3 months ago
JSON representation
Breadcrumbs helper for Middleman (http://www.middlemanapp.com)
- Host: GitHub
- URL: https://github.com/marnen/middleman-breadcrumbs
- Owner: marnen
- License: mit
- Created: 2014-09-10T18:17:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-07-26T18:06:55.000Z (over 4 years ago)
- Last Synced: 2024-03-15T12:26:07.374Z (11 months ago)
- Language: Ruby
- Homepage:
- Size: 37.1 KB
- Stars: 11
- Watchers: 2
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://travis-ci.org/marnen/middleman-breadcrumbs.svg)
# middleman-breadcrumbs
Breadcrumbs helper for [Middleman](https://middlemanapp.com/)
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Configuration
This gem has two configuration options, which are set in the [usual way for Middleman extensions](https://middlemanapp.com/advanced/configuration/#configuring-extensions).
-
:separator
-
String that separates the breadcrumb levels. Default is>
.
-
:wrapper
-
Tag name (as a symbol) in which to wrap each breadcrumb level. Default isnil
, which means no wrapping.
For example, if you wanted to wrap the breadcrumb levels in `
```ruby
activate :breadcrumbs, separator: ' • ', wrapper: :li
```
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs. By default, this will use the separator and wrapper defined in the `config.rb` file.
If you want to override the separator or wrapper defined in the `config.rb` file, pass the appropriate options to the `breadcrumbs` method:
```erb
<%= breadcrumbs(current_page, separator: ' ||| ', wrapper: :div) %>
```